By the way this is the code I use for calculating probability. I think it’s okay.
                ps = torch.exp(log_ps)
                top_p, top_class = ps.topk(1, dim=1)
                equals = top_class == labels.view(*top_class.shape)
        accuracy = torch.mean(equals.type(torch.FloatTensor))
        print(f'Accuracy: {accuracy.item()*100}%')

I tried different loss functions. I tried changing the learning rate. I tried increasing and decreasing the batch size. But I still have the same problem. The accuracy is too low compared to other models that were used on the same data. It wiggles between 3% to 15% which pretty much random I guess.