QuantScientist:

Using the original example, I can see that the original labels, are NOT one hot encoded, do I assume correctly that
cross-entropy and neg. log-likelihood losses in pytorch do NOT require one-hot encodings?


yes,they don’t require
I have a rough look at your code, the bug seems come from self.X_train, self.X_train[index] is not  string