avalanche.evaluation.metric_definitions.PluginMetric

class avalanche.evaluation.metric_definitions.PluginMetric[source]

A metric that can be used together with EvaluationPlugin.

This class leaves the implementation of the result and reset methods to child classes while providing an empty implementation of the callbacks invoked by the EvaluationPlugin. Subclasses should implement the result, reset and the desired callbacks to compute the specific metric.

Remember to call the super() method when overriding after_train_iteration or after_eval_iteration.

An instance of this class usually leverages a Metric instance to update, reset and emit metric results at appropriate times (during specific callbacks).

__init__()[source]

Creates an instance of a plugin metric.

Child classes can safely invoke this (super) constructor as the first experience.

Methods

__init__()

Creates an instance of a plugin metric.

after_backward(strategy)

after_eval(strategy)

after_eval_dataset_adaptation(strategy)

after_eval_exp(strategy)

after_eval_forward(strategy)

after_eval_iteration(strategy)

after_forward(strategy)

after_train_dataset_adaptation(strategy)

after_training(strategy)

after_training_epoch(strategy)

after_training_exp(strategy)

after_training_iteration(strategy)

after_update(strategy)

before_backward(strategy)

before_eval(strategy)

before_eval_dataset_adaptation(strategy)

before_eval_exp(strategy)

before_eval_forward(strategy)

before_eval_iteration(strategy)

before_forward(strategy)

before_train_dataset_adaptation(strategy)

before_training(strategy)

before_training_epoch(strategy)

before_training_exp(strategy)

before_training_iteration(strategy)

before_update(strategy)

reset(**kwargs)

Resets the metric internal state.

result(**kwargs)

Obtains the value of the metric.