avalanche.evaluation.metric_definitions.Metric

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

Definition of a 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)

Methods

__init__(*args, **kwargs)

reset(**kwargs)

Resets the metric internal state.

result(**kwargs)

Obtains the value of the metric.