avalanche.logging.TensorboardLogger

class avalanche.logging.TensorboardLogger(tb_log_dir: Union[str, pathlib.Path] = './tb_data', filename_suffix: str = '')[source]

The TensorboardLogger provides an easy integration with Tensorboard logging. Each monitored metric is automatically logged to Tensorboard. The user can inspect results in real time by appropriately launching tensorboard with tensorboard –logdir=/path/to/tb_log_exp_name.

AWS’s S3 buckets and (if tensorflow is installed) GCloud storage url are supported.

If no parameters are provided, the default folder in which tensorboard log files are placed is “./runs/”. .. note:

We rely on PyTorch implementation of Tensorboard. If you
don't have Tensorflow installed in your environment,
tensorboard will tell you that it is running with reduced
feature set. This should not impact on the logger performance.
__init__(tb_log_dir: Union[str, pathlib.Path] = './tb_data', filename_suffix: str = '')[source]

Creates an instance of the TensorboardLogger.

Parameters
  • tb_log_dir – path to the directory where tensorboard log file will be stored. Default to “./tb_data”.

  • filename_suffix – string suffix to append at the end of tensorboard log file. Default ‘’.

Methods

__init__([tb_log_dir, filename_suffix])

Creates an instance of the TensorboardLogger.

after_backward(strategy, metric_values, **kwargs)

Called after criterion.backward() by the BaseStrategy.

after_eval(strategy, metric_values, **kwargs)

Called after eval by the BaseStrategy.

after_eval_dataset_adaptation(strategy, ...)

Called after eval_dataset_adaptation by the BaseStrategy.

after_eval_exp(strategy, metric_values, **kwargs)

Called after eval_exp by the BaseStrategy.

after_eval_forward(strategy, metric_values, ...)

Called after model.forward() by the BaseStrategy.

after_eval_iteration(strategy, ...)

Called after the end of an iteration by the BaseStrategy.

after_forward(strategy, metric_values, **kwargs)

Called after model.forward() by the BaseStrategy.

after_train_dataset_adaptation(strategy, ...)

Called after train_dataset_adapatation by the BaseStrategy.

after_training(strategy, metric_values, **kwargs)

Called after train by the BaseStrategy.

after_training_epoch(strategy, ...)

Called after train_epoch by the BaseStrategy.

after_training_exp(strategy, metric_values, ...)

Called after train_exp by the BaseStrategy.

after_training_iteration(strategy, ...)

Called after the end of a training iteration by the BaseStrategy.

after_update(strategy, metric_values, **kwargs)

Called after optimizer.update() by the BaseStrategy.

before_backward(strategy, metric_values, ...)

Called before criterion.backward() by the BaseStrategy.

before_eval(strategy, metric_values, **kwargs)

Called before eval by the BaseStrategy.

before_eval_dataset_adaptation(*args, **kwargs)

Called before eval_dataset_adaptation by the BaseStrategy.

before_eval_exp(strategy, metric_values, ...)

Called before eval_exp by the BaseStrategy.

before_eval_forward(strategy, metric_values, ...)

Called before model.forward() by the BaseStrategy.

before_eval_iteration(strategy, ...)

Called before the start of a training iteration by the BaseStrategy.

before_forward(strategy, metric_values, **kwargs)

Called before model.forward() by the BaseStrategy.

before_train_dataset_adaptation(*args, **kwargs)

Called before train_dataset_adapatation by the BaseStrategy.

before_training(strategy, metric_values, ...)

Called before train by the BaseStrategy.

before_training_epoch(strategy, ...)

Called before train_epoch by the BaseStrategy.

before_training_exp(strategy, metric_values, ...)

Called before train_exp by the BaseStrategy.

before_training_iteration(strategy, ...)

Called before the start of a training iteration by the BaseStrategy.

before_update(strategy, metric_values, **kwargs)

Called before optimizer.update() by the BaseStrategy.

log_metric(metric_value, callback)

This method will be invoked on each callback.

log_single_metric(name, value, x_plot)

This abstract method will have to be implemented by each subclass.