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:
-
y(TensorOrTensors) –The predicted outputs.
-
y_true(TensorOrTensors) –The ground-truth targets.
-
sample_weights(TensorOrTensors | None, default:None) –Optional sample weights.
Returns:
-
Tensor–A tensor representing the computed loss.