# Should the input to the negative log likelihood loss function be probabilities?

I am trying to train a supervised model where the output from the model is output of a linear function $$WX + b$$. Kindly note that I'm not using any softmax or $$\log$$ softmax on the result of the linear. I am using negative log-likelihood loss function, which takes the input as the linear output from the model and the true labels. I am getting decent accuracy by doing this, but I have read that the input to negative log-likelihood function must be probabilities. Am I doing something wrong?

• log softmax is used for classification problems only. Are you solving a classification problem? If not you should use a MSEloss or something for regression task. Apart from that softmax takes the network output and transforms it to probabilities. NLL just takes the negative logarithm. So for classification you usually combine a softmax followed by NLL. However, in praxis you often do this in one go that avoids explicit calculation of steps inbetween for better numerical stability, such combined function is often called CrossEntropy loss. So take that for a classifica. task with raw net output. – Marcel_marcel1991 Dec 30 '18 at 14:06

$$\sum_y (y-\hat{y})^2$$