DSKSD / DeepNLP-models-Pytorch

Pytorch implementations of various Deep NLP models in cs-224n(Stanford Univ)
MIT License
2.95k stars 660 forks source link

duplicated softmax functions are called in a single model #2

Open shengyehchen opened 6 years ago

shengyehchen commented 6 years ago

torch.nn.CrossEntropyLoss() combines LogSoftMax and NLLLoss in one single class. Thus, there should be only "return out" instead of return _"F.logsoftmax(out)" in the forward() function of some classification models.