stop_tolerance=20, reduce_tolerance=15) # set `learning_rate` parameter or None for custom schedule learning model.compile(learning_rate=0.001) model.load_checkpoint(target=target_path) if args.train: model.summary(output_path, "summary.txt") callbacks = model.get_callbacks(logdir=output_path, checkpoint=target_path, verbose=1) start_time = datetime.datetime.now() h = model.fit(x=dtgen.next_train_batch(), epochs=args.epochs, steps_per_epoch=dtgen.steps['train'], validation_data=dtgen.next_valid_batch(), validation_steps=dtgen.steps['valid'], callbacks=callbacks, shuffle=True, verbose=1) total_time = datetime.datetime.now() - start_time loss = h.history['loss'] accuracy = h.history['accuracy'] val_loss = h.history['val_loss'] val_accuracy = h.history['val_accuracy']
learning_rate=0.001) model = HTRModel(inputs=ioo[0], outputs=ioo[1]) model.compile(optimizer=ioo[2]) checkpoint = "checkpoint_weights.hdf5" model.load_checkpoint(target=os.path.join(output_path, checkpoint)) if args.train: model.summary(output_path, "summary.txt") callbacks = model.get_callbacks(logdir=output_path, hdf5=checkpoint, verbose=1) start_time = time.time() h = model.fit_generator(generator=dtgen.next_train_batch(), epochs=args.epochs, steps_per_epoch=dtgen.train_steps, validation_data=dtgen.next_valid_batch(), validation_steps=dtgen.valid_steps, callbacks=callbacks, shuffle=True, verbose=1) total_time = time.time() - start_time loss = h.history['loss'] val_loss = h.history['val_loss'] min_val_loss = min(val_loss) min_val_loss_i = val_loss.index(min_val_loss)