PyTorch's negative log-likelihood loss, nn.NLLLoss
is defined as:
So, if the loss is calculated with the standard weight of one in a single batch the formula for the loss is always:
-1 * (prediction of model for correct class)
Example:
Correct Class = 0
prediction of model for correct class = 0.5
loss = -1 * 0.5
So, why is it called the "negative log-likelihood loss", if there isn't a log function involved in calculating the loss?