avalanche.evaluation.metrics.LossMetric

class avalanche.evaluation.metrics.LossMetric[source]

Loss Metric.

Instances of this metric keep the running average loss over multiple <prediction, target> pairs of Tensors, provided incrementally.

Each time result is called, this metric emits the average loss 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 a loss value of 0.

__init__()[source]

Creates an instance of the loss metric.

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

Methods

__init__()

Creates an instance of the loss metric.

reset()

Resets the metric.

result()

Retuns the running average loss per pattern.

update(loss, patterns)

Update the running loss.