zero.metrics.Metric.calculate_iter¶
-
Metric.calculate_iter(iterable, star=False)[source]¶ Calculate metric for iterable.
The method does the following:
resets the metric
sequentially updates the metric with every value from
iterablecomputes the result
resets the metric
returns the result
- Parameters
iterable (Iterable) – data for
Metric.updatestar (bool) – if
True, thenupdate(*x)is performed instead ofupdate(x)
- Returns
The result of
Metric.compute.- Return type
Any
Examples
metrics = metric_fn.calculate_iter(map(predict_batch, val_loader))