osc.utils.AverageMetric

class AverageMetric[source]

Bases: object

Keep track of the average value of a metric across batches

Methods

compute

Compute.

update

Update.

compute()[source]

Compute.

Return type

float

Returns

The current average.

update(values)[source]

Update.

Parameters

values (Tensor) – a 1D tensor of per-sample metric values.