March 2019
Intermediate to advanced
196 pages
4h 50m
English
We are now in a position to train the model using the fit method. Note the use of the validation set, which is distinct from the training set. The callbacks list can also be used for operations such as saving the best model or terminating training when learning has stopped if this happens before all the epochs have finished. See https://keras.io/callbacks/ for details:
epochs=25callbacks=[tf.keras.callbacks.TensorBoard(logdir = "./tb_log_dir")]model.fit( x_train, y_train, batch_size=batch_size, epochs=epochs, callbacks=callbacks, verbose=1, validation_data=(x_valid, y_valid))
Depending on the hardware configuration the model finds itself in, this model will train quite quickly if it's running on a GPU, or slowly ...
Read now
Unlock full access