tf.keras.callbacks.LambdaCallback

Callback for creating simple, custom callbacks on-the-fly.

Inherits From: Callback

Used in the notebooks

Used in the tutorials

This callback is constructed with anonymous functions that will be called at the appropriate time (during Model.{fit | evaluate | predict}). Note that the callbacks expects positional arguments, as:

  • on_epoch_begin and on_epoch_end expect two positional arguments: epoch, logs
  • on_batch_begin and on_batch_end expect two positional arguments: batch, logs
  • on_train_begin and on_train_end expect one positional argument: logs