LRMonitor#
- class composer.callbacks.LRMonitor[source]#
Logs the learning rate.
This callback iterates over all optimizers and their parameter groups to log learning rate under the
lr-{OPTIMIZER_NAME}/group{GROUP_NUMBER}
key.Example
>>> from composer import Trainer >>> from composer.callbacks import LRMonitor >>> # constructing trainer object with this callback >>> trainer = Trainer( ... model=model, ... train_dataloader=train_dataloader, ... eval_dataloader=eval_dataloader, ... optimizers=optimizer, ... max_duration="1ep", ... callbacks=[LRMonitor()], ... )
The learning rate is logged by the
Logger
to the following key as described below.Key
Logged data
lr-{OPTIMIZER_NAME}/group{GROUP_NUMBER}
Learning rate for each optimizer and parameter group for that optimizer is logged to a separate key.