betty.logging package
Betty provides an automatic logging feature to easily track train loss, validation accuracy, etc.
Users can specify metrics to be logged through train_step
method of Problem
class, and
validation
method of Engine
class. Currently, Betty supports two types of loggers:
TensorBoardLogger
and WandBLogger
.
Tensorboard Logger
-
class betty.logging.logger_tensorboard.TensorBoardLogger(comment='')[source]
-
close()[source]
Close PyTorch’s tensorboard SummaryWriter
.
-
log(stats, tag=None, step=None)[source]
Log metrics/stats to PyTorch tensorboard.
- Parameters:
stats (dict) – Dictoinary of values and their names to be recorded
tag (str, optional) – Data identifier
step (int, optional) – step value associated with stats
to record
WandB Logger
-
class betty.logging.logger_wandb.WandBLogger[source]
-
log(stats, tag=None, step=None)[source]
Log metrics/stats to Weight & Biases (wandb) logger
- Parameters:
stats (dict) – Dictoinary of values and their names to be recorded
tag (str, optional) – Data identifier
step (int, optional) – step value associated with stats
to record
Base Logger
-
class betty.logging.logger_base.LoggerBase[source]
-
static debug(msg, *args, **kwargs)[source]
Logs a message with level DEBUG on the global logger
- Parameters:
msg (str) – debugg message
-
static error(msg, *args, **kwargs)[source]
Logs a message with level ERROR on the global logger
- Parameters:
msg (str) – error message
-
static info(msg, *args, **kwargs)[source]
Logs a message with level INFO on the global logger
- Parameters:
msg (str) – info message
-
log(stats, tag=None, step=None)[source]
Log metrics/stats to a visualization logger (e.g. tensorboard, wandb)
- Parameters:
stats (dict) – Dictoinary of values and their names to be recorded
tag (str, optional) – Data identifier
step (int, optional) – step value associated with stats
to record
-
static warning(msg, *args, **kwargs)[source]
Logs a message with level WARNING on the global logger
- Parameters:
msg (str) – warning message
-
betty.logging.logger_base.get_logger()[source]
Get global logger.