cnn-text-classification-pytorch icon indicating copy to clipboard operation
cnn-text-classification-pytorch copied to clipboard

F.softmax(logits) and CrossEntropyLoss() is right?

Open alphanlp opened this issue 6 years ago • 0 comments

torch.nn.CrossEntropyLoss(weight=None, size_average=None, ignore_index=-100, reduce=None, reduction='mean')[SOURCE] This criterion combines nn.LogSoftmax() and nn.NLLLoss() in one single class. I guess F.softmax(logits) and CrossEntropyLoss() used together is wrong?

alphanlp avatar Jan 15 '19 09:01 alphanlp