jp_letendre:

I was wondering why the negative log likelihood function ( NLLLoss() ) in torch.nn expected a target. The torch.nn.NLLLoss() uses nll_loss(input, target, weight=self.weight, ignore_index=self.ignore_index, reduction=self.reduction) in his forward call


I think this is incorrect and nll_loss already assumes that you pass log(probabilities). You test this by giving it  just probabilities (onehot format with values in range [0, 1]) and it will give you negative values.