Skip to content

opto.trainer.loggers

DefaultLogger module-attribute

DefaultLogger = ConsoleLogger

BaseLogger

BaseLogger(log_dir='./logs', **kwargs)

Initialize the logger. This method can be overridden by subclasses.

log_dir instance-attribute

log_dir = log_dir

log

log(name, data, step, **kwargs)

Log a message with the given name and data at the specified step.

Args: name: Name of the metric data: Value of the metric step: Current step/iteration **kwargs: Additional arguments (e.g., color)

ConsoleLogger

ConsoleLogger(log_dir='./logs', **kwargs)

Bases: BaseLogger

A simple logger that prints messages to the console.

log

log(name, data, step, **kwargs)

Log a message to the console.

Args: name: Name of the metric data: Value of the metric step: Current step/iteration **kwargs: Additional arguments (e.g., color)

TensorboardLogger

TensorboardLogger(log_dir='./logs', verbose=True, **kwargs)

Bases: ConsoleLogger

A logger that writes metrics to TensorBoard.

verbose instance-attribute

verbose = verbose

writer instance-attribute

writer = SummaryWriter(log_dir)

log

log(name, data, step, **kwargs)

Log a message to TensorBoard.

Args: name: Name of the metric data: Value of the metric step: Current step/iteration **kwargs: Additional arguments (not used here)

WandbLogger

WandbLogger(
    log_dir="./logs", verbose=True, project=None, **kwargs
)

Bases: ConsoleLogger

A logger that writes metrics to Weights and Biases (wandb).

verbose instance-attribute

verbose = verbose

wandb instance-attribute

wandb = wandb

log

log(name, data, step, **kwargs)

Log a message to Weights and Biases.

Args: name: Name of the metric data: Value of the metric step: Current step/iteration **kwargs: Additional arguments (not used here)