avalanche.evaluation.metrics.TaskAwareLoss

class avalanche.evaluation.metrics.TaskAwareLoss[source]

The standalone Loss metric. This is a general metric used to compute more specific ones.

Instances of this metric keeps the running average loss over multiple <prediction, target> pairs of Tensors, provided incrementally. The “prediction” and “target” tensors may contain plain labels or one-hot/logit vectors.

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([task_label])

Resets the metric.

result([task_label])

Retrieves the running average loss per pattern.

update(loss, patterns, task_label)

Update the running loss given the loss Tensor and the minibatch size.