PyTorch · Class
nn.NLLLoss
NLLLoss computes negative log likelihood for class-index targets. It expects log-probabilities, usually produced by LogSoftmax, and supports class weights and ignored targets.
Last updated
Syntax
torch.nn.NLLLoss(weight=None, size_average=None, ignore_index=-100, reduce=None, reduction='mean')In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.
SubscribeRelated
LogSoftmaxCrossEntropyLoss