Ah, sorry for the confusion, as I can see the misunderstanding now.
nn.NLLLoss expects log probabilities, so you should just apply F.log_softmax on your model output (not multiplying with -1!).
The formula posted in my previous post is, how the loss can be calculated, but you shouldn’t worry about the minus sign, as it will be applied internally for you.
The posted example shows, how to apply the criterion.