Hi Dwight and Mohamed!
I would like to offer two clarifications:



 Dwight_Foster:

However for predicting values with your model you would have to use a softmax function.


If by “predicting values” you mean predicting class labels, this is not
true.  To get a predicted class label from the probabilities returned by
softamx() you take argmax().  But softmax() does not change the
order of the values, so you can just as well take argmax() of the logits
you would have input to softmax().  That is, you can skip softmax()
altogether.


You can also include a softmax function in your model and just use the nllloss function and it would do the same thing.


This is not quite right.  You would need to use pytorch’s log_softmax()
followed by nll_loss() to reproduce pytorch’s cross_entropy().
Best.
K. Frank