composer.Callback
Callbacks are run at each given Event
, and are used to for
non-essential recording functions such as logging or timing.
Callbacks differ from Algorithm
in that
they do not modify the training of the model.
By convention, callbacks should not modify the State
.
Each callback inherits from the Callback
base class,
and overrides functions corresponding to the event.
For example:
from composer import Callback
class MyCallback(Callback)
def epoch_start(self, state: State, logger: Logger):
print(f'Epoch {state.epoch}/{state.max_epochs}')
Note
To use Composer’s built in callbacks, see composer.callbacks.
Base class for callbacks. |
|
Base class for callbacks that should only run on the rank 0 process. |