class avalanche.evaluation.metric_definitions.Metric(*args, **kwargs)[source]

Standalone metric.

A standalone metric exposes methods to reset its internal state and to emit a result. Emitting a result does not automatically cause a reset in the internal state.

The specific metric implementation exposes ways to update the internal state. Usually, standalone metrics like Sum, Mean, Accuracy, … expose an update method.

The Metric class can be used as a standalone metric by directly calling its methods. In order to automatically integrate the metric with the training and evaluation flows, you can use PluginMetric class. The class receives events directly from the EvaluationPlugin and can emits values on each callback. Usually, an instance of Metric is created within PluginMetric, which is then responsible for its update and results. See PluginMetric for more details.

__init__(*args, **kwargs)


__init__(*args, **kwargs)


Resets the metric internal state.


Obtains the value of the metric.