LearningRateMonitor#

class braintools.trainer.LearningRateMonitor(logging_interval='step', log_momentum=False)#

Monitor and log learning rate during training.

Parameters:
  • logging_interval (str) – When to log the learning rate. One of ‘step’ or ‘epoch’.

  • log_momentum (bool) – Reserved for logging optimizer momentum values. Not yet implemented; the value is accepted but currently has no effect.

Examples

>>> lr_monitor = LearningRateMonitor(logging_interval='epoch')
>>> trainer = Trainer(callbacks=[lr_monitor])
property lr_history: List[Dict[str, float]]#

History of logged learning rates.

on_train_batch_start(trainer, module, batch, batch_idx)[source]#

Log learning rate at step start.

on_train_epoch_start(trainer, module)[source]#

Log learning rate at epoch start.