In a multi-class classification, I sometimes see the following two implementations:


nn.Linear + nn.CrossEntropyLoss


nn.LogSoftmax + nn.NLLLoss


Are they both the same in terms of the following?

Both are softmax classifiers
Mathematically
Model training efficiency
Any other differences?

What are the trade-offs to consider?
If the intention is to do binary classification, what’s the most efficiency way to output a probability?