Skip to content

Average Loss

eva.metrics.AverageLoss

Bases: Metric

Average loss metric tracker.

Source code in src/eva/core/metrics/average_loss.py
def __init__(self) -> None:
    """Initializes the metric."""
    super().__init__()

    self.add_state("value", default=torch.tensor(0), dist_reduce_fx="sum")
    self.add_state("total", default=torch.tensor(0), dist_reduce_fx="sum")