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.

Callback

Base class for callbacks.

RankZeroCallback

Base class for callbacks that only run on the rank zero process.