Hi jpj!



 jpj:

When I was using softmax and not CrossEntropyLoss I would just do target == torch.argmax(prediction) but since CrossEntropyLoss applies softmax itself, I’m not using softmax on final layer.


Please note that softmax() – which converts raw-score logits to
probabilities – does not change the order of the values.  That is:
torch.argmax (prediction) == torch.argmax (torch.nn.functional.softmax (prediction))

Therefore you can continue to use:
target == torch.argmax (prediction)

unchanged.
Best.
K. Frank