Deep learning at 2,000 ft¶
Deep learning is one idea pursued relentlessly: build a function out of many simple differentiable layers, define a loss that says how wrong it is, and let gradient descent, driven by backpropagation, tune every parameter at once. This track builds that machine by hand, from a single neuron to a deep residual network, and then teaches you to train it properly.
10,000 ft
Every system behind the 2012–2026 AI boom is a deep network: the convolutional nets that won ImageNet in 2012, the transformers behind every large language model (transformers and LLMs), the diffusion models that generate images (generative models) and the policy and value networks of AlphaZero and RL-trained reasoning models (reinforcement learning). What they share is not an architecture but a method: representations are learned end to end from data, rather than designed by hand, by differentiating a loss through a deep composition of layers. Classical machine learning (the ML track) taught you to fit a model to features; deep learning learns the features too. Everything later on this site assumes the mechanics in this track: what a layer computes, how gradients flow, why depth needs care, and what to do when training goes wrong.
The whole of deep learning in one loop¶
Strip away the architectures and every deep learning system runs the same loop millions of times:
Five ingredients decide whether that loop produces something useful, and each has its own part of this track:
| Ingredient | The question it answers | Where |
|---|---|---|
| Architecture | What family of functions can the network express, and what does it assume about the data? | MLPs, CNNs, RNNs, residual networks, embeddings |
| Gradients | How do we get \(\partial L/\partial\theta\) for a billion parameters cheaply? | backpropagation, autodiff |
| Trainability | Will signals and gradients survive 100 layers? | activations, initialisation and normalisation, residuals |
| Optimisation | How do we turn gradients into good steps? | optimisers |
| Generalisation | Why does a network with more parameters than data points work on new data? | regularisation, the training recipe |
The mental model to keep
A deep network is a stack of learned coordinate changes. Each layer re-describes its input in coordinates that make the next layer's job easier, until the last layer's job is a straight line. Training is gradient descent on all the coordinate changes at once. Most of the engineering in this track exists to keep that gradient descent well-behaved as the stack gets deep.
The map of the track¶
The pages build on each other. Arrows mean "you need this first"; the left half is the engine, the right half is what you build with it.
How to work through this track¶
The track is two units. Unit 1 (this page and the next five) is the engine: a neuron, how gradients are computed, and how to make depth trainable. Unit 2 is the craft: optimisers, regularisation, the classic architectures and a practical training recipe.
- Neurons, perceptrons and MLPs (about 1 hour). The building block, XOR, universal approximation and why depth beats width.
- Backpropagation from scratch (about 75 minutes). Derive and implement it; the single most important page in the track. Do the Build it section by hand.
- Automatic differentiation (about 70 minutes). Generalise backprop to any program; forward versus reverse mode; how PyTorch and JAX work.
- Activation functions (about 50 minutes). Sigmoid to ReLU to GELU to SwiGLU, and the one number (\(\chi\)) that explains the history.
- Initialisation and normalisation (about 70 minutes). Xavier, He, BatchNorm, LayerNorm, RMSNorm and pre-norm.
- Optimisers, regularisation, CNNs, RNNs and LSTMs, embeddings, residual networks and the training recipe: roughly an hour each.
Budget 12–15 hours of real study for the whole track, plus the projects. Two fast paths:
- Heading for LLMs? Do 1 → 2 → 4 → 5, then optimisers, embeddings and residual networks, then go straight to attention.
- Want to build, not read? Pair pages 1–3 with Project: build micrograd, and the second unit with Project: build and train a tiny GPT.
The one exercise that teaches the most
Write backpropagation for a two-layer MLP in NumPy with no framework, gradient-check it, and train it on a toy dataset until it hits 100% training accuracy. Then add three layers and switch the activation to sigmoid, and watch it stop learning. The backpropagation page gives you the starting code; the rest of unit 1 explains everything that goes wrong.
Every page in the track¶
-
A weighted sum and a bend; XOR, hidden layers, universal approximation and the sawtooth that shows why depth wins.
-
The chain rule run backwards: a fully worked numeric example, the four equations, gradient checking, vanishing gradients.
-
Forward and reverse mode, dual numbers, tapes, JVPs and VJPs, and how PyTorch and JAX actually compute gradients.
-
Sigmoid, tanh, ReLU, GELU, SiLU and gated units; why each replaced the last, measured in a 30-layer network.
-
Initialisation and normalisation
Xavier and He from variance arithmetic; BatchNorm, LayerNorm, RMSNorm; pre-norm versus post-norm; μP.
-
SGD, momentum, Adam and AdamW, learning-rate schedules and warm-up.
-
Dropout, weight decay, data augmentation, and why over-parameterised networks still generalise.
-
Weight sharing across space: kernels, pooling, receptive fields and the architectures that won ImageNet.
-
RNNs, LSTMs and sequence-to-sequence
Weight sharing across time, gating, and the encoder–decoder idea that led to attention.
-
Embeddings and representation learning
Turning discrete things into vectors whose geometry means something.
-
Residual connections and very deep networks
The identity shortcut that made 100+ layers trainable and became the backbone of the transformer.
-
A recipe for training (and debugging) networks
The practical playbook: baselines, overfitting a batch, learning-rate finding, monitoring, and common failures.
Deep learning in seven dates¶
| Year | Event | Read |
|---|---|---|
| 1958 | Rosenblatt's perceptron learns a linear boundary | MLPs |
| 1986 | Rumelhart, Hinton and Williams popularise backpropagation | backprop |
| 1989 | LeCun's convolutional network reads handwritten zip codes | CNNs |
| 1997 | Hochreiter and Schmidhuber's LSTM | RNNs |
| 2012 | AlexNet wins ImageNet with ReLUs, dropout and GPUs | activations |
| 2015 | Batch normalisation; ResNet trains 152 layers | normalisation, residuals |
| 2017 | The transformer | the transformer block |
Bengio, Hinton and LeCun received the 2018 ACM Turing Award for this work, and Hinton shared the 2024 Nobel Prize in Physics with John Hopfield "for foundational discoveries and inventions that enable machine learning with artificial neural networks". The full story is in the deep learning reset.
Prerequisites from other tracks¶
You need these before or alongside unit 1:
- Vectors and the geometry of meaning and matrices as linear maps: a layer is a matrix.
- Tensors, shapes and broadcasting: every bug you will write is a shape bug first.
- Derivatives and gradients and the multivariable chain rule: backpropagation is nothing else.
- Probability from first principles and entropy and cross-entropy: the losses.
- Linear regression and logistic regression: a neural network's last layer, already familiar.
- Your workbench: Python, NumPy and PyTorch installed.
Helpful but not required: optimisation, bias, variance and regularisation, floating point and log-sum-exp.
The five best resources for this track¶
- Neural Networks: Zero to Hero — Andrej Karpathy. From micrograd to a GPT, in code, at the pace of a patient tutor. If you only do one thing alongside this track, do this.
- Understanding Deep Learning — Simon J. D. Prince, MIT Press 2023, free PDF. The best modern textbook: precise, beautifully illustrated, with notebooks.
- Neural networks — 3Blue1Brown. The visual intuition for layers, gradient descent and backpropagation, then transformers.
- Deep Learning — Goodfellow, Bengio and Courville, 2016. Still the reference for the foundations (part II), free online.
- Deep learning — LeCun, Bengio and Hinton, Nature 2015. Ten pages from the three Turing laureates on what deep learning is and why it works; the best single overview paper.
Where this leads¶
- Start the track: Neurons, perceptrons and MLPs.
- Already comfortable with MLPs and backprop? Jump to activation functions or initialisation and normalisation.
- Then on to transformers and LLMs, which reuse every idea in this track.