class avalanche.logging.StrategyLogger[source]

The base class for the strategy loggers.

Strategy loggers will receive events, under the form of callback calls, from the EvaluationPlugin carrying a reference to the strategy as well as the values emitted by the metrics.

Each child class should implement the log_single_metric method, which specifies how to report to the user the metrics gathered during training and evaluation flows. The log_single_metric method is invoked by default on each callback. In addition, child classes may override the desired callbacks to customize the logger behavior.


Make sure, when overriding callbacks, to call the proper super method.




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.