ML Foundations

Maths, machine learning, deep learning and LLMs, from scratch. Free, step by step: every lesson is complete, with an animation, a worked example and exercises with answers.

Unit 0: Your toolkit

Get fast with the tools you will use every day. This unit is short: do it alongside the start of Unit 1.

Unit 1: Math foundations

The language of ML. You will see matrices as movements of space, gradients as directions, and loss functions as probabilities.

Unit 2: Classical ML, built by you

Build every classic algorithm yourself in NumPy. After this unit, a library is only a shortcut for something you already understand.

Unit 3: Deep learning foundations

Build neural networks from a single neuron up. Write backprop by hand first. Then you can trust PyTorch, because you know what it does.

Unit 4: Transformers and LLMs

Build a small GPT from scratch: tokenizer, attention, training and fine-tuning. This is how modern AI works inside.

Unit 5: AI engineering

Turn foundation models into real products: retrieval, evaluation, agents and deployment. This is the core of most AI engineer jobs.

Unit 6: Systems and scale

Make models fast and cheap. Understand what limits speed and memory on a GPU, and how training works across many GPUs.

Unit 7: Generative models and reinforcement learning

Models that create new data, and models that learn by trial and error. These ideas power image generators, and the reinforcement learning behind RLHF.