TorchLean API

NN.Proofs.Autograd.Tape.Nodes.Losses.NLL

Negative Log-Likelihood #

Negative log-likelihood for one-hot targets when the input is already log-probabilities.

Negative log-likelihood loss for log-probabilities and one-hot targets of shape (m×n).

Forward: -(1/m) * ⟪target, logProbs⟫

This is the natural primitive loss that cross_entropy reduces to after log_softmax.

Instances For

    NodeFDerivCorrect for nll_one_hot_last (negative log-likelihood with one-hot targets).

    Instances For