Thanks for reply. But I have added an epsilon to the log and my loss function was NLLLoss.
And I used torch.nn.LogSoftmax and NLLLoss at the beginning, its result was the worst one, and that is why I separated softmax and log operation…