Simple Machine Learning What it means for a computer to learn, from a straight line through data to how large language models are built, trained, tuned and checked. Every model is written from scratch in NumPy first, then used from a library.
Each lesson lists the sources it follows, mostly the official Python, NumPy, scikit-learn and PyTorch documentation. See all sources .
Last updated 6 December 2026
M The capstone: A small language model, end to end: a tokeniser, a GPT-style transformer trained on a public-domain text, instruction tuning, an evaluation and a model card.
Stage 8 : Convolutional networks Understand how networks see, from one multiply-add of a convolution to ResNet, detection and segmentation.
8.1 Images as numbers Not written yet 8.2 Convolution Not written yet 8.3 Stride, padding, channels Not written yet 8.4 Pooling and the full CNN Not written yet 8.5 What CNNs learn Not written yet 8.6 The ImageNet years Not written yet 8.7 Transfer learning Not written yet 8.8 Efficient CNNs Not written yet 8.9 Object detection Not written yet 8.10 Segmentation Not written yet 8.P Project: a CNN for CIFAR-10 Not written yet Stage 9 : Sequences Process text, sound and time series in order, and meet attention as the fix for a real problem.
9.1 Sequences and order Not written yet 9.2 Recurrent networks Not written yet 9.3 Backpropagation through time Not written yet 9.4 LSTM Not written yet 9.5 GRU, and RNNs in PyTorch Not written yet 9.6 Sequence to sequence Not written yet 9.7 The first attention Not written yet 9.P Project: a character-level text generator Not written yet Stage 10 : Transformers Understand the transformer completely, from one attention head by hand to a full block in PyTorch.
10.1 Attention without recurrence Not written yet 10.2 Self-attention in NumPy Not written yet 10.3 Masks Not written yet 10.4 Multi-head attention Not written yet 10.5 Positions Not written yet 10.6 The transformer block Not written yet 10.7 Encoder, decoder, and both Not written yet 10.8 Build a transformer in PyTorch Not written yet 10.9 The cost of attention Not written yet 10.10 Vision Transformers Not written yet 10.11 Mixture of experts Not written yet 10.P Project: a transformer that sorts and adds Not written yet Stage 11 : Natural language processing Turn text into numbers and back, in English and Filipino, from counting words to fine-tuning BERT.
11.1 Text as data Not written yet 11.2 Bag of words and TF-IDF Not written yet 11.3 Language models with n-grams Not written yet 11.4 Subword tokenisation Not written yet 11.5 Word embeddings Not written yet 11.6 Text classification with neural networks Not written yet 11.7 Contextual embeddings and BERT Not written yet 11.8 Fine-tuning a pretrained model Not written yet 11.9 Tagging: parts of speech and named entities Not written yet 11.10 Translation, summarisation and their metrics Not written yet 11.11 Sentence embeddings and semantic search Not written yet 11.P Project: Filipino and English sentiment Not written yet Stage 12 : Audio Turn sound into features a model can learn from, and understand how modern speech recognisers work.
12.1 Sound as numbers Not written yet 12.2 Frequencies and the Nyquist limit Not written yet 12.3 The Fourier transform Not written yet 12.4 Spectrograms Not written yet 12.5 Mel spectrograms and MFCCs Not written yet 12.6 Classifying sounds Not written yet 12.7 Keyword spotting Not written yet 12.8 Speech recognition and CTC Not written yet 12.9 Self-supervised speech: wav2vec 2.0 Not written yet 12.10 Whisper Not written yet 12.11 Music and making sound Not written yet 12.P Project: a voice command app Not written yet Stage 13 : Large language models How an LLM is made and used: pretraining, sampling, instruction tuning, and building on one responsibly.
13.1 From GPT to today Not written yet 13.2 Pretraining Not written yet 13.3 Scaling laws Not written yet 13.4 Decoding and sampling Not written yet 13.5 Inference: KV cache, batching and memory Not written yet 13.6 From base model to assistant: instruction tuning Not written yet 13.7 Learning from preferences: RLHF and DPO Not written yet 13.8 Prompting and in-context learning Not written yet 13.9 Retrieval-augmented generation Not written yet 13.10 Tools and agents Not written yet 13.11 Reasoning models Not written yet 13.12 Efficient fine-tuning: LoRA and QLoRA Not written yet 13.13 Quantisation and small models Not written yet 13.14 Evaluating LLMs Not written yet 13.15 Hallucination, safety and looking inside Not written yet 13.P Project: train a small GPT Not written yet Stage 14 : Generative models How models make new images and sounds, from autoencoders to diffusion, and how text steers them.
14.1 Autoencoders Not written yet 14.2 Variational autoencoders Not written yet 14.3 GANs Not written yet 14.4 Diffusion: adding noise Not written yet 14.5 Diffusion: learning to denoise Not written yet 14.6 CLIP: joining text and images Not written yet 14.7 Text to image Not written yet 14.8 Flow matching and what’s next Not written yet 14.P Project: a tiny diffusion model Not written yet Stage 15 : Learning by doing: reinforcement learning Learn from rewards, from a grid world solved by hand to PPO and the ideas behind AlphaGo.
15.1 Agents, rewards and bandits Not written yet 15.2 Markov decision processes Not written yet 15.3 Values and the Bellman equation Not written yet 15.4 Q-learning Not written yet 15.5 Deep Q-networks Not written yet 15.6 Policy gradients and PPO Not written yet 15.7 Search and self-play: AlphaGo and AlphaZero Not written yet 15.P Project: teach an agent to balance a pole Not written yet Stage 16 : More model families Short lessons on families a practitioner will meet: graphs, time series, recommenders and state-space models.
16.1 Graph neural networks Not written yet 16.2 Time series and forecasting Not written yet 16.3 Recommender systems Not written yet 16.4 State-space models Not written yet 16.5 Self-supervised learning for images Not written yet Stage 17 : Responsible machine learning Build models that are fair, explainable, private, robust, documented and lawful, and know when not to build one.
17.1 Where bias comes from Not written yet 17.2 Measuring fairness Not written yet 17.3 Explaining predictions Not written yet 17.4 Privacy Not written yet 17.5 Robustness and adversarial examples Not written yet 17.6 Documenting models and data Not written yet 17.7 Energy and cost Not written yet 17.8 Deploying and monitoring Not written yet 17.9 Rules and laws Not written yet Capstone Build a small language model end to end, and document it like a real release.
C.1 The plan Not written yet C.2 The tokeniser Not written yet C.3 The model Not written yet C.4 Pretraining Not written yet C.5 Generating Not written yet C.6 Teaching it to follow instructions Not written yet C.7 Preferences Not written yet C.8 Evaluation Not written yet C.9 Shrinking and sharing Not written yet C.10 The model card Not written yet