Skip to content

average

allennlp.training.metrics.average

[SOURCE]


Average#

@Metric.register("average")
class Average(Metric):
 | def __init__(self) -> None

This Metric breaks with the typical Metric API and just stores values that were computed in some fashion outside of a Metric. If you have some external code that computes the metric for you, for instance, you can use this to report the average result using our Metric API.

__call__#

class Average(Metric):
 | ...
 | @overrides
 | def __call__(self, value)

Parameters

  • value : float
    The value to average.

get_metric#

class Average(Metric):
 | ...
 | @overrides
 | def get_metric(self, reset: bool = False)

Returns

  • The average of all values that were passed to __call__.

reset#

class Average(Metric):
 | ...
 | @overrides
 | def reset(self)