Let’s train a model
Hi — I’m Sean Egan. In this workshop, we’ll follow the numbers from a single input to a trained model, then train one on data of our own.
Part I
What the Machine Holds — and How to Shape Work for It
Read the shapes and find the independent work.
-
1A Number with a ShapeRead the containers a model holds
2Space That StretchesA matrix moves a whole space at once
3A Layer Is a MatrixWarp the input space, shift it, then bend it
4Why a GPU, Not a CPUFollow the arithmetic to find the parallel work
5From Loops to MatricesTurn repeated work into tensor operations
6Shaping a Problem for the GPUChoose the axes before writing the computation
7The Forward Pass, Every NumberFollow an input through two layers
Part II
What the Machine Does, One Step at a Time
Follow the loss, gradients, updates, and dashboard.
-
8How Wrong Is It: Loss, Entropy, Cross-EntropyPut a number on a prediction’s error
9Downhill: the GradientFit a line, one visible update at a time
10Backwards: How the Gradient Reaches Every LayerTrace the chain rule through the model
11The Training LoopA batch, a prediction, a loss, and an update
12Reading the Graphs: What Training Should Look LikeThe four curves everyone watches, and the shapes a healthy run makes
13What Gets Tracked, and What It Looks LikeRead the changing measurements of a training run
Part III
The Architectures, Each Trained for Real
Inspect six model families as they learn.
-
14The Dense Network (MLP)Watch stacked layers learn a spiral boundary
15The Convolutional Network (CNN)Train shared filters on handwritten digits
16The Recurrent Network (RNN, GRU)Carry a hidden state through a sequence
17The TransformerWatch attention change while a model learns names
18The Graph Network (GNN)Learn by passing messages between connected nodes
19The AutoencoderCompress a digit to two numbers and reconstruct it
Part IV
Doing It Yourself
Prepare data, design a run, and evaluate your own model.
-
20Getting Data into TensorsShape, split, and normalize your examples
21Designing the RunChoose the objective, model, batch, and learning rate
22Did It Actually Learn? EvaluationCompare held-out predictions with a baseline
23When It Goes WrongConnect symptoms to causes and checks
24Train Your Own ModelRun trainkit on your data and read your weights
25Glossary and NotationFind a term, its meaning, and the chapter that introduced it
Part V
The Weather Models We Trained Here
Four weather-model stories from the machine this book was written on: three trained models and one design. Same loop, same graphs, same honesty about what worked.
-
26True Colour from Three BandsLearning a missing-green correction against a polar-orbiter reference
27Super-Resolution, 2×A residual network that starts as bicubic and learns only what bicubic gets wrong
28Nowcasting the RadarSixty minutes ahead, five minutes at a time, measured against the classical forecasts
29Doppler Everywhere (designed, not yet trained)Turning cloud-top temperatures into reflectivity where no radar reaches — designed, not yet trained