Thanks for the replies.
I tried running the following code for my model trained with softmax and nn.NLLLoss.
        loss_fct = nn.NLLLoss(reduce=False)
        print(loss_fct(torch.log(y_model), y))

This outputs:
Variable containing:
 16.9570
[torch.cuda.FloatTensor of size 1 (GPU 0)]

I’m not sure if NLLLoss is supposed to be used with softmax, in their code they used logsoftmax with NLLLoss, but I changed it to softmax to get probabilities. Does this mean I need to change the loss function to nn.CrossEntropyLoss to get the model to train right?