Namespace Keras.Callbacks
Classes
BaseLogger
Callback that accumulates epoch averages of metrics. This callback is automatically applied to every Keras model.
Callback
Abstract base class used to build new callbacks. The logs dictionary that callback methods take as argument will contain keys for quantities relevant to the current batch or epoch. Currently, the.fit() method of the Sequential model class will include the following quantities in the logs that it passes to its callbacks: on_epoch_end: logs include acc and loss, and optionally include val_loss(if validation is enabled in fit), and val_acc(if validation and accuracy monitoring are enabled). on_batch_begin: logs include size, the number of samples in the current batch.on_batch_end: logs include loss, and optionally acc(if accuracy monitoring is enabled).
CSVLogger
Callback that streams epoch results to a csv file. Supports all values that can be represented as a string, including 1D iterables such as np.ndarray.
EarlyStopping
Stop training when a monitored quantity has stopped improving.
History
Callback that records events into a History object. This callback is automatically applied to every Keras model.The History object gets returned by the fit method of models.
LearningRateScheduler
Learning rate scheduler.
ModelCheckpoint
Save the model after every epoch. filepath can contain named formatting options, which will be filled with the values of epoch and keys in logs(passed in on_epoch_end). For example: if filepath is weights.{epoch:02d}-{val_loss:.2f}.hdf5, then the model checkpoints will be saved with the epoch number and the validation loss in the filename.
ProgbarLogger
Callback that prints metrics to stdout.
ReduceLROnPlateau
Reduce learning rate when a metric has stopped improving. Models often benefit from reducing the learning rate by a factor of 2-10 once learning stagnates. This callback monitors a quantity and if no improvement is seen for a 'patience' number of epochs, the learning rate is reduced.
RemoteMonitor
Callback used to stream events to a server. Requires the requests library.Events are sent to root + '/publish/epoch/end/' by default. Calls are HTTP POST, with a data argument which is a JSON-encoded dictionary of event data.If send_as_json is set to True, the content type of the request will be application/json.Otherwise the serialized JSON will be send within a form
TensorBoard
TensorBoard basic visualizations. TensorBoard is a visualization tool provided with TensorFlow. This callback writes a log for TensorBoard, which allows you to visualize dynamic graphs of your training and test metrics, as well as activation histograms for the different layers in your model. If you have installed TensorFlow with pip, you should be able to launch TensorBoard from the command line: tensorboard --logdir=/ full_path_to_your_logs When using a backend other than TensorFlow, TensorBoard will still work(if you have TensorFlow installed), but the only feature available will be the display of the losses and metrics plots.
TerminateOnNaN
Callback that terminates training when a NaN loss is encountered.