Cerebras Model Zoo Loggers#
This module contains the base Logger class as well as a few useful Logger subclasses.
- class cerebras.modelzoo.trainer.loggers.Logger[source]#
Bases:
cerebras.modelzoo.trainer.callbacks.callback.Callback
,abc.ABC
Base class for logging metrics to different backends.
It is a simple subclass of Callback that features one additional abstract method log which needs to be implemented by the derived classes.
Loggers#
The Logger subclasses available out-of-the-box.
ProgressLogger
#
- class cerebras.modelzoo.trainer.loggers.ProgressLogger[source]#
Bases:
cerebras.modelzoo.trainer.loggers.logger.Logger
Callback that handles setting up and logging to the standard Python logger.
Sets up the rate tracker and total samples tracker.
- static format_rate(rate)[source]#
Format the rate for logging.
Use two significant digits if the rate is less than 1.0, otherwise use two decimal places.
- Parameters
rate (float) – Rate to format.
- property postfix: List[str]#
Returns the postfix to append to the progress message.
TensorBoardLogger
#
- class cerebras.modelzoo.trainer.loggers.TensorBoardLogger(summary_dir=None, legacy_event_dirs=False)[source]#
Bases:
cerebras.modelzoo.trainer.loggers.logger.Logger
Logger class that logs metrics to Tensorboard.
- Parameters
summary_dir (Optional[str]) – Directory to save the Tensorboard logs. If None, use the trainer’s model_dir.
legacy_event_dirs (bool) – If True, use the legacy directory structure for event files. This option exists to maintain some backwards compatibility and should not be set to True or relied on if at all possible.