avalanche.evaluation.metrics.R2
- class avalanche.evaluation.metrics.R2[source]
R2 metric. This is a standalone metric.
The update method computes the R2 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 R2 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 R2 value of 0.
- __init__()[source]
Creates an instance of the standalone R2 metric.
By default this metric in its initial state will return an R2 value of 0. The metric can be updated by using the update method while the running R2 can be retrieved using the result method.
Methods
__init__()Creates an instance of the standalone R2 metric.
reset()Resets the metric.
result()Retrieves the running R2.
update(predicted_y, true_y)Update the running R2 given the true and predicted labels.