callbacks_list monitors the model' validation loss keras callbacks reducelronplateaumonitor='val_lossfactor= divides the learning rate by when triggered patience= the callback is triggered after the validation loss has stopped improving for epochs model fit(xyepochs= batch_size= callbacks=callbacks_listvalidation_data=(x_valy_val)because the callback will monitor the validation lossyou need to pass validation_data to the call to fit writing your own callback if you need to take specific action during training that isn' covered by one of the built-in callbacksyou can write your own callback callbacks are implemented by subclassing the class keras callbacks callback you can then implement any number of the following transparently named methodswhich are called at various points during trainingon_epoch_begin on_epoch_end called at the start of every epoch called at the end of every epoch on_batch_begin on_batch_end called right before processing each batch called right after processing each batch on_train_begin on_train_end called at the start of training called at the end of training these methods all are called with logs argumentwhich is dictionary containing information about the previous batchepochor training runtraining and validation metricsand so on additionallythe callback has access to the following attributesself model--the model instance from which the callback is being called self validation_data--the value of what was passed to fit as validation data here' simple example of custom callback that saves to disk (as numpy arraysthe activations of every layer of the model at the end of every epochcomputed on the first sample of the validation setimport keras import numpy as np class activationlogger(keras callbacks callback)called by the parent model before trainingto inform the callback of what model will be calling it def set_model(selfmodel)self model model layer_outputs [layer output for layer in model layersself activations_model keras models model(model inputlayer_outputsdef on_epoch_end(selfepochlogs=none)if self validation_data is noneraise runtimeerror('requires validation_data 'licensed to model instance that returns the activations of every layer