Skip to content

Loss

minnt.Loss

Bases: Protocol

An abstract loss function interface.

__call__

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

Compute loss of the given predictions and gold targets, optionally with sample weights.

Parameters:

Returns:

  • Tensor

    A tensor representing the computed loss.