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

How to check local and global angular versions

 Use the command ng version (or ng v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to f...