December 2018
Intermediate to advanced
274 pages
7h 46m
English
The next step is to compile and train the model. We put the model through the training phase with a series of iterations. Epochs determine the number of iterations to be done on a model in the training phase. The weights will be passed to the layers defined in the model. A good number of Epochs will give greater accuracy and minimum loss. Here, we are using 10 Epochs.
Keras has a callback mechanism that will be called during each training iteration of the model, that is, at the end of each Epoch. In the callback method, we save the computed weights of that Epoch:
callbacks_list = [ keras.callbacks.ModelCheckpoint( filepath='best_model.{epoch:02d}-{val_loss:.2f}.h5', monitor='val_loss', save_best_only=True), ...Read now
Unlock full access