Dmitriy:

It seems I need use criterion = nn.NLLLoss() for reducing excess work ?


I believe using F.logsigmoid(x) might be undesired as your (log) probabilities will be independent for both classes (one class might have probability 0.5 and the other 0.7).  Your model might still train well, but the outputted probabilities will not add up to one. For simplicity, I suggest to use
return x

instead of
return F.logsigmoid(x)

and use nn.CrossEntropyLoss() which will take care of both nn.LogSoftmax() and nn.NLLLoss(). Using nn.LogSoftmax() will make sure your probabilities across classes add up to one.