Negative log-likelihood (NLL) measures how poorly a probabilistic model assigns probability to observed outcomes: it is the negative logarithm of their likelihood. Maximizing log likelihood is therefore equivalent to minimizing NLL. section 5.4 section 11.2.1
For binary logistic regression, NLL is the loss optimized from conditional class probabilities. Stochastic gradient descent updates parameters using its gradient; regularization can be added to control parameter size. section 5.4
The same objective extends from classification to learned probability densities:
- A mixture density network predicts Gaussian-mixture parameters, including means, covariances, and mixture proportions, and minimizes the resulting NLL. section 11.2.1
- The neural network enforces positive variances with exponential activations and mixture weights summing to one with softmax activations. section 11.2.1
- Under an isotropic Gaussian covariance assumption, the multivariate density can be rewritten as a product across dimensions before constructing the loss. section 11.2.1
Two implementations
A from-scratch SGD logistic-regression implementation computes a regularized objective and gradient, schedules the learning rate, and exposes fit and predict operations. A Keras/TensorFlow Gaussian mixture density network generates synthetic multivariate data, predicts constrained mixture parameters, computes NLL, and reports training and validation loss. section 5.4 section 11.2.1
Figure 11.7 A multioutput neural network used to learn Gaussian parameters
Shows the multi-output neural-network structure used to learn Gaussian mixture parameters for NLL training. section 11.2.1






