NLLLoss2d Calculation

When calculating NLLLoss2d, is the loss averaged or summed over pixels?

By default, loss is averaged over pixels*batch_size. This behavior can be controlled: http://pytorch.org/docs/master/nn.html?highlight=nllloss#torch.nn.NLLLoss2d

1 Like

Thanks. The documentation explains it very well. :smiley: