NLLLoss2d Calculation


(Mohit Sharma) #1

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


#2

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


(Mohit Sharma) #3

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