zero.metrics.Metric.calculate

Metric.calculate(*args, **kwargs)[source]

Calculate metric for a single input.

The method does the following:

  1. resets the metric

  2. updates the metric with (*args, **kwargs)

  3. computes the result

  4. resets the metric

  5. returns the result

Parameters
  • *args – arguments for Metric.update

  • arguments for Metric.update (**kwargs) –

Returns

The result of Metric.compute.

Return type

Any