Maximum likelihood: where losses come from

Choose the parameters under which the data you actually saw is most probable. That one principle gives you squared error, cross-entropy and, once you add a prior, weight decay.

50 min

After this lesson you can

  • Distinguish probability from likelihood, and explain why we maximise the log-likelihood
  • Derive the maximum-likelihood estimates for a coin and for a Gaussian
  • Show that minimising squared error is maximum likelihood under Gaussian noise
  • Show that cross-entropy is the negative log-likelihood of Bernoulli and categorical outputs
  • Derive MAP estimation and show that a Gaussian prior is L2 regularisation

In this lesson

  1. Probability and likelihood: one formula, two readings
  2. A coin, by hand
  3. A Gaussian, by hand
  4. Squared error is maximum likelihood with Gaussian noise
  5. Cross-entropy is maximum likelihood for classes
  6. Priors: MAP estimation and regularisation
  7. In code

This lesson is part of Descent Pro

Descent Pro unlocks every lesson on the route, from base camp to the summit. Every plan starts with a free trial.

Descent Pro

Start your free trial to keep reading

This lesson, and every other lesson on the route, is part of Descent Pro. Every plan starts with a free trial, and students with a .edu email get longer. Cancel before the trial ends and you pay nothing.