Skip to content

Metric

minnt.Metric

Bases: Module, ABC

An abstract metric interface.

update abstractmethod

update(
    y: TensorOrTensors,
    y_true: TensorOrTensors | None = None,
    sample_weights: TensorOrTensors | None = None,
) -> None

Update the internal state of the metric with new predictions and possibly gold targets.

Optional sample weights might be provided if supported by the metric.

Parameters:

compute abstractmethod

compute() -> Tensor

Compute the accumulated metric value.

Returns:

  • Tensor

    A (usually scalar) tensor representing the accumulated metric value.

reset abstractmethod

reset() -> None

Reset the internal state of the metric.