xnn.common.train.loggers#

Training loggers: where the trainer’s metrics go (console, CSV, TensorBoard or your own).

A logger receives flat {name: value} dictionaries with the optimizer step they belong to. The Trainer sends one per epoch (epoch, lr, train/<term>, val/<term>), one after the test evaluation (test/<term>) and, with log_every_n_steps > 0, the training batch values (train_step/<term>). Subclass Logger to send them anywhere else.

Module Attributes

LOGGERS

Logger names accepted by cfg.loggers.

Functions

build_loggers(spec)

Turn a logger specification into a list of loggers.

Classes

CSVLogger([save_dir, filename])

Writes every logged dictionary as one row of a CSV file (step plus one column per metric).

ConsoleLogger([errors])

Prints the epoch summary, the test loss and any step values to stdout.

Logger()

Base class of the training loggers; override log_metrics() (and optionally the others).

TensorBoardLogger([save_dir])

Writes the metrics as TensorBoard scalars through torch.utils.tensorboard.SummaryWriter.