Keras callbacks are utility functions that you can pass to a Keras model's .fit() method to add functionality to its default behavior. Multiple callbacks can be defined, which will be called by Keras either before or after each batch iteration, each epoch, or the whole training procedure. Predefined Keras callbacks include the following:
- CSVLogger: Logs training information in a CSV file.
- EarlyStopping: Stops training if the loss or a metric stops improving. It can be useful in avoiding overfitting.
- LearningRateScheduler: Changes the learning rate on each epoch according to a schedule.
- ReduceLROnPlateau: Automatically reduces the learning rate when the loss or a metric stops improving.
It is also possible to create custom callbacks by subclassing tf.keras.callbacks.Callback, as demonstrated in later chapters and their code samples.