← All subjects

Learn

Learn machine learning

Ten parts, 52 sessions. Predict a result, try the controls, then compare what happened with your prediction. Explore browser calculations, recorded training runs and small models trained for the course. Each result tells you which it uses.

No coding or prior calculus required. We introduce the maths through small, worked examples. Start with made-up loan applications, then build towards networks and text prediction. Learn how models improve, and how to check whether an improvement holds on new examples. Nothing you type leaves the page.

New to all of this? Start here: a five-minute primer

See the complete learning syllabus →

Your notebook

Reading your notebook.

Open your progress, saved models and results

Explore vision, rewards and model errors

7 optional interactive lessons, open in any order. These experiments sit alongside the 52-session core track; they do not add notebook gates or change your saved progress.

  1. Convolutional neural networks

    Move a filter across pixels, inspect a feature map, and compare convolution, ReLU and pooling.

    Open lesson →
  2. Reinforcement learning

    Train a small gridworld agent. Follow one Q-value update, then compare exploration with its learned policy.

    Open lesson →
  3. Reward hacking

    Give a courier the wrong reward. Compare its score with completed deliveries, then repair the incentive.

    Open lesson →
  4. Hallucination and uncertainty

    Compare guessing with abstaining, and check whether evidence actually supports an answer.

    Open lesson →
  5. Sycophancy

    Change the reward for agreeing with a user. See how the preferred answer can change while the fact stays fixed.

    Open lesson →
  6. Retrieval evaluation

    Change chunking and retrieval settings. Measure evidence coverage, missing answers and context cost on a fixed question set.

    Open lesson →
  7. Diffusion: noise and denoising

    Step through a small probability model from noise towards a distribution. Inspect an analytic score and the limits of the illustration.

    Open lesson →

Each session ends with a check: reach a target, predict what happens on new examples, or demonstrate the idea yourself. Save your takeaway in the notebook. The short code identifies the session there.

Part 1: Data and the rules of the game

Where the numbers come from, and what a score does not tell you.

  1. 1.1 What a prediction is Open session →, not yet, available now

    rule.hand35 minutesDemonstrate what you learned

  2. 1.2 Features: the model only sees columns Open session →, not yet, earlier sessions first

    feat.columns30 minutesTry new examples

  3. 1.3 Train, validate, test Open session →, not yet, earlier sessions first

    split.three30 minutesTry new examples

  4. 1.4 Accuracy, precision, recall, F1 Open session →, not yet, earlier sessions first

    metric.four30 minutesDemonstrate what you learned

  5. 1.5 Accuracy lies Open session →, not yet, earlier sessions first

    metric.cost25 minutesReach a target

Part 2: Decision trees

Nested cuts you can see, chosen by a search you can check by hand.

  1. 2.1 Cuts by hand Open session →, not yet, earlier sessions first

    tree.hand30 minutesReach a target

  2. 2.2 Impurity and splits Open session →, not yet, earlier sessions first

    tree.split40 minutesTry new examples

  3. D1 Entropy versus Gini on the 14-row weather table Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveDerivation40 minutes

  4. 2.3 Depth and overfitting Open session →, not yet, earlier sessions first

    tree.depth35 minutesDemonstrate what you learned

  5. 2.4 Pruning and instability Open session →, not yet, earlier sessions first

    tree.prune30 minutesTry new examples

  6. D2 Cost-complexity pruning Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveDerivation40 minutes

  7. 2.5 Tree audit Open session →, not yet, earlier sessions first

    tree.audit25 minutesReach a target

Part 3: Ensembles and random forests

How trees with different errors can make a better prediction together.

  1. 3.1 Many weak voters Open session →, not yet, earlier sessions first

    vote.crowd30 minutesTry new examples

  2. 3.2 Bootstrap and feature bagging Open session →, not yet, earlier sessions first

    forest.random35 minutesTry new examples

  3. D3 Out-of-bag error as free validation Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveHarder target30 minutes

  4. 3.3 Feature importance Open session →, not yet, earlier sessions first

    forest.permute30 minutesDemonstrate what you learned

  5. 3.4 Forest versus tree Open session →, not yet, earlier sessions first

    forest.vs20 minutesTry new examples

Part 4: Lines, loss and gradients

A weighted sum, a loss that cares about confidence, and a slope.

  1. 4.1 The dot product is a score Open session →, not yet, earlier sessions first

    dot.score30 minutesDemonstrate what you learned

  2. 4.2 Sigmoid and log-loss Open session →, not yet, earlier sessions first

    loss.bet35 minutesReach a target

  3. 4.3 Slope without calculus Open session →, not yet, earlier sessions first

    slope.numeric30 minutesDemonstrate what you learned

  4. 4.4 Gradient descent by hand Open session →, not yet, earlier sessions first

    grad.step40 minutesReach a target

  5. D4 Momentum and Adam, hand-stepped Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveDerivation50 minutes

  6. 4.5 Softmax and temperature Open session →, not yet, earlier sessions first

    softmax.temp25 minutesDemonstrate what you learned

  7. 4.6 Where lines fail Open session →, not yet, earlier sessions first

    xor.wall20 minutesTry new examples

Part 5: Perceptron, MLP and backpropagation

Layers that build features, and the bookkeeping that assigns blame.

  1. 5.1 One neuron Open session →, not yet, earlier sessions first

    neuron.one25 minutesDemonstrate what you learned

  2. 5.2 Hidden layers build features Open session →, not yet, earlier sessions first

    mlp.hidden40 minutesReach a target

  3. 5.3 Activations matter Open session →, not yet, earlier sessions first

    mlp.relu25 minutesTry new examples

  4. 5.4 Backprop by hand Open session →, not yet, earlier sessions first

    backprop.blame45 minutesDemonstrate what you learned

  5. D5 Every weight of the 2-2-1 network, then the matrix form Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveDerivation60 minutes

  6. 5.5 Initialisation and batches Open session →, not yet, earlier sessions first

    train.setup30 minutesTry new examples

  7. 5.6 Beat the forest Open session →, not yet, earlier sessions first

    mlp.vs.forest40 minutesReach a target

Part 6: Training dynamics

Reading curves: capacity, regularisers, folds and shift.

  1. 6.1 The overfitting machine Open session →, not yet, earlier sessions first

    fit.over30 minutesDemonstrate what you learned

  2. 6.2 Three regularisers Open session →, not yet, earlier sessions first

    reg.three35 minutesTry new examples

  3. D6 The dataset where dropout hurts Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveReversal40 minutes

  4. 6.3 Cross-validation Open session →, not yet, earlier sessions first

    cv.folds30 minutesTry new examples

  5. 6.4 Distribution shift Open session →, not yet, earlier sessions first

    shift.time25 minutesTry new examples

  6. 6.5 Debug four trainings Open session →, not yet, earlier sessions first

    debug.four20 minutesTry new examples

Part 7: Sequences: RNN and LSTM

Order as information, a fixed-size state, and a gradient that fades.

  1. 7.1 Order is information Open session →, not yet, earlier sessions first

    seq.order25 minutesDemonstrate what you learned

  2. 7.2 Hidden state Open session →, not yet, earlier sessions first

    rnn.state40 minutesTry new examples

  3. 7.3 Vanishing gradients Open session →, not yet, earlier sessions first

    grad.vanish35 minutesDemonstrate what you learned

  4. 7.4 LSTM gates Open session →, not yet, earlier sessions first

    lstm.gates40 minutesDemonstrate what you learned

  5. D7 The LSTM's gradient path Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveDerivation45 minutes

  6. 7.5 Train a character model Open session →, not yet, earlier sessions first

    lstm.train40 minutesReach a target

Part 8: Embeddings, attention and transformers

Co-occurrence as geometry, then a similarity-weighted average.

  1. 8.1 Embeddings Open session →, not yet, earlier sessions first

    embed.near35 minutesDemonstrate what you learned

  2. 8.2 Attention by hand Open session →, not yet, earlier sessions first

    attn.hand45 minutesDemonstrate what you learned

  3. D8 Two heads of dimension one, by hand Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveDerivation45 minutes

  4. 8.3 Self-attention and heads Open session →, not yet, earlier sessions first

    attn.heads35 minutesTry new examples

  5. 8.4 Positional information Open session →, not yet, earlier sessions first

    pos.shuffle25 minutesTry new examples

  6. 8.5 The transformer block Open session →, not yet, earlier sessions first

    block.assemble35 minutesDemonstrate what you learned

  7. D9 Layer norm by hand and the residual ablation at depth 8 Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveDerivation and harder target40 minutes

  8. 8.6 Attention versus LSTM Open session →, not yet, earlier sessions first

    attn.vs.lstm25 minutesTry new examples

Part 9: Scaling to language models

Subword ids, one distribution at a time, and what scale predicts.

  1. 9.1 Tokenisation Open session →, not yet, earlier sessions first

    bpe.merge35 minutesDemonstrate what you learned

  2. D10 The tokeniser and your language Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveReversal40 minutes

  3. 9.2 Next-token prediction Open session →, not yet, earlier sessions first

    next.token40 minutesDemonstrate what you learned

  4. D11 Top-k, top-p and temperature Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveHarder target40 minutes

  5. 9.3 What scale buys Open session →, not yet, earlier sessions first

    scale.loss30 minutesTry new examples

  6. 9.4 Pretraining and fine-tuning Open session →, not yet, earlier sessions first

    tune.stages40 minutesTry new examples

  7. 9.5 Mechanism, not mind Open session →, not yet, earlier sessions first

    mind.mechanism30 minutesDemonstrate what you learned

  8. 9.6 Context windows and retrieval Open session →, not yet, earlier sessions first

    ctx.cost25 minutesTry new examples

Part 10: Mixture-of-Experts and capstone

Routing, load balancing, and the pipeline you assemble yourself.

  1. 10.1 The router Open session →, not yet, earlier sessions first

    moe.route40 minutesDemonstrate what you learned

  2. 10.2 Load balancing Open session →, not yet, earlier sessions first

    moe.balance30 minutesReach a target

  3. D12 Capacity factor and token dropping Open deep dive →, optional deep dive, not yet, earlier sessions first

    deep diveHarder target45 minutes

  4. 10.3 Capstone Open session →, not yet, earlier sessions first

    capstone.build50 minutesReach a target

  5. 10.4 The map Open session →, not yet, earlier sessions first

    map.place20 minutesDemonstrate what you learned

12 optional deep dives sit beside the sessions. A deep dive opens when its session is done and never blocks anything.