Monday, May 17, 2021

Keras Callbacks


Keras Callback is an object that can perform actions at various stages of training. 

It can be used for various things like logging, model saving, early stopping, etc. 


The points at which you can insert a callback are: 

1. Global points : On the begining and end of training/testing/prediction

  • on_(train|test|predict)_begin(self, logs=None)
  • on_(train|test|predict)_end(self, logs=None)

2. Batch level points: 

  • on_(train|test|predict)_batch_begin(self, batch, logs=None)
  • on_(train|test|predict)_batch_end(self, batch, logs=None)

3. Epoch level points:

  • on_epoch_begin(self, epoch, logs=None)
  • on_epoch_end(self, epoch, logs=None)


Apart from this, keras also provides built-in callbacks:

  • ModelCheckpoint
  • TensorBoard
  • EarlyStopping
  • LearningRateScheduler
  • ReduceLROnPlateau
  • RemoteMonitor
  • LambdaCallback
  • TerminateOnNaN
  • CSVLogger
  • ProgbarLogger


No comments:

Post a Comment

Loop Engineering: Designing the Systems That Prompt Your Agents

Loop Engineering For the last couple of years, the core skill in working with AI was writing a good prompt. You'd craft careful instru...