Solved by KFrank in post #2 
              
              
                Hi Hiep! 

The issue is that NLLLoss expects log-probabilities, rather than 
probabilities, as its input. 
From the documentation for NLLLoss: 

The input given through a forward call is expected to contain 
log-probabilities of each class. 

If you calculate log (y_hat) yourself, you will get the e…