avalanche.evaluation.metrics.Accuracy

class avalanche.evaluation.metrics.Accuracy[source]

Accuracy metric. This is a standalone metric.

The update method computes the accuracy incrementally by keeping a running average of the <prediction, target> pairs of Tensors provided over time.

The “prediction” and “target” tensors may contain plain labels or one-hot/logit vectors.

Each time result is called, this metric emits the average accuracy across all predictions made since the last reset.

The reset method will bring the metric to its initial state. By default this metric in its initial state will return an accuracy value of 0.

__init__()[source]

Creates an instance of the standalone Accuracy metric.

By default this metric in its initial state will return an accuracy value of 0. The metric can be updated by using the update method while the running accuracy can be retrieved using the result method.

Methods

__init__()

Creates an instance of the standalone Accuracy metric.

reset()

Resets the metric.

result()

Retrieves the running accuracy.

update(predicted_y, true_y)

Update the running accuracy given the true and predicted labels.