Semester 3 · Elective
Probabilistic ML & Bayesian Methods
https://epochschool.com/subjects/probabilistic-ml-bayesian-methods
Machine learning that knows what it does not know. You treat unknown parameters and even unknown functions as random, compute posteriors exactly where conjugacy allows (conjugate families, Bayesian linear regression and its model evidence, Gaussian processes) and approximate them where it does not, building EM, the Laplace approximation, variational inference and Markov chain Monte Carlo from scratch.
You then put the ideas to work: uncertainty for neural networks with MC dropout, deep ensembles and last-layer Laplace, judged by proper scoring rules, calibration error and out-of-distribution tests, and Bayesian optimisation for expensive tuning. Every method is derived by hand first and implemented on one CPU core; the elective is open to learners of both tracks.
- Prerequisites
- Required: Finish this subject before you start. The subject builds directly on it.Recommended: Helpful background. You can start without it if you are willing to fill the gaps.
What you’ll be able to do
- LO1Write a model as a generative story and a factorised joint distribution, and carry out exact Bayesian inference with conjugate priors, including posteriors, posterior predictive distributions, credible intervals and hierarchical shrinkage.
- LO2Derive Bayesian linear regression and its predictive distribution, separate noise from parameter uncertainty, and use the model evidence to set hyperparameters and compare models, knowing where it misleads.
- LO3Derive the Laplace approximation, apply it to Bayesian logistic regression with its moderated predictive distribution, and recognise posteriors for which a Gaussian approximation fails.
- LO4Derive the evidence lower bound from the inference side, apply EM to latent-variable and missing-data models, and fit mean-field and reparameterised variational approximations, explaining the biases the direction of the KL divergence introduces.
- LO5Implement Metropolis-Hastings, Gibbs sampling and Hamiltonian Monte Carlo from their correctness conditions, and diagnose convergence and efficiency with trace plots, split R-hat and effective sample size.
- LO6Build Gaussian process regression from kernels, fit its hyperparameters by maximising the marginal likelihood, and use it as the surrogate in Bayesian optimisation with expected improvement and confidence-bound acquisitions.
- LO7Quantify predictive uncertainty in neural networks with MC dropout, deep ensembles and last-layer Laplace, separate aleatoric from epistemic uncertainty, and evaluate it with proper scoring rules, calibration error, selective prediction and out-of-distribution detection.
- LO8Express a model as a probabilistic program and choose and justify an inference method (exact, Laplace, variational or MCMC) for a given model, data size and decision, reporting uncertainty honestly.
Chapters
- 01Bayesian inference: priors, posteriors and conjugacy
- 02Bayesian linear models: regression, evidence and the Laplace approximation
- 03Latent variables, EM and variational inference
- 04Markov chain Monte Carlo and probabilistic programming
- 05Gaussian processes and Bayesian optimisation
- 06Uncertainty in deep learning
Graded labs
- L1
Conjugate updates, Bayesian linear regression and the Laplace approximation
After chapter 2 · about 5 hours · Synthetic school districts · Course own work, CC BY 4.0 · Runs on a CPU
- L2
EM for missing data and robust regression, and variational logistic regression
After chapter 3 · about 5 hours · Diabetes dataset · BSD-3-Clause (scikit-learn) · Runs on a CPU
- L3
MCMC from scratch: Metropolis, Gibbs, HMC and the diagnostics that keep you honest
After chapter 4 · about 5 hours · Breast Cancer Wisconsin · BSD-3-Clause (scikit-learn) · Runs on a CPU
- L4
Gaussian processes and Bayesian optimisation
After chapter 5 · about 5 hours · Seeded 2-D response surface · Course own work, CC BY 4.0 · Runs on a CPU
- L5
Uncertainty for neural networks: MC dropout, deep ensembles and last-layer Laplace
After chapter 6 · about 6 hours · Optical recognition of handwritten digits · BSD-3-Clause (scikit-learn) · Runs on a CPU
Before you start
Required
Finish this subject before you start. The subject builds directly on it.
Linear Algebra & Calculus for ML
Foundations of Machine Learning
Neural Networks & Deep Learning
Recommended
Helpful background. You can start without it if you are willing to fill the gaps.
Optimisation & Training at Scale
Classical AI: Search, Logic & Reasoning
How it’s taught
You read short sections written for the page. Each ends with a check, and in-browser exercises let you practise. Graded labs run on your own cloud lab machine, CPU-friendly.
No videos. No live classes. No AI tutor.