Phase 3 of 7 · 16 topics
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.
A neural network is many small logistic regressions stacked in layers and trained together with backprop. Phase 2 made the bricks. Phase 3 builds the wall.
Core resources for this phase
-
Video
Andrej Karpathy: Neural Networks: Zero to Hero Free
Builds everything from scratch in Python. Code along, then rebuild it without the video.
-
Book
Understanding Deep Learning (Simon Prince) Free
The main deep learning text for this phase. Very clear figures, with practice notebooks.
-
Video
3Blue1Brown: Neural Networks Free
Optional. Backprop and gradient descent shown with moving pictures, if you want a second view of the topics.
Topics, in order
-
3.1 The neuron and the multi-layer perceptron
-
Watch
Neural Networks, Ch 1: But what is a neural network?
3Blue1Brown
Worth it: Layers of glowing neurons recognising handwritten digits. The best first picture of what a network is and what its weights do.
-
Interactive
TensorFlow · runs in the browser
-
Read
Understanding Deep Learning, Ch 3–4 (shallow and deep networks)
Simon Prince · free
-
Read
Neural Networks and Deep Learning, Ch 1
Michael Nielsen · free
-
Watch
-
3.2 Activation functions, and why non-linearity matters
-
Watch
Neural Networks Pt. 3: ReLU In Action
StatQuest (Josh Starmer)
-
Interactive
TensorFlow · runs in the browser
Worth it: Switch between linear, ReLU, tanh and sigmoid and watch the decision boundary bend (or stay stubbornly straight) as the network trains, live.
- Read
-
Read
Understanding Deep Learning, Ch 3 (activation functions)
Simon Prince · free
-
Watch
-
3.3 Backpropagation by hand
-
Watch
Neural Networks, Ch 3: What is backpropagation really doing?
3Blue1Brown
Worth it: Shows each weight being pulled up or down by the error, layer by layer, as moving pictures. The intuition behind every equation in this topic.
-
Watch
Neural Networks, Ch 4: Backpropagation calculus
3Blue1Brown
-
Watch
Building makemore Part 4: Becoming a Backprop Ninja
Andrej Karpathy
-
Read
CS231n: Backpropagation, Intuitions
Stanford
-
Watch
-
3.4 Autograd and computational graphs
-
Watch
The spelled-out intro to neural networks and backpropagation: building micrograd
Andrej Karpathy
Worth it: Builds a complete autograd engine from scratch, live, in plain Python. Long, but after it loss.backward() holds no mystery at all.
- Read
- Read
-
Watch
-
3.5 Softmax and cross-entropy loss
-
Watch
Neural Networks Part 5: ArgMax and SoftMax
StatQuest (Josh Starmer)
-
Watch
Neural Networks Part 6: Cross Entropy
StatQuest (Josh Starmer)
- Read
-
Watch
-
3.6 Optimisers: SGD, momentum, Adam; learning-rate schedules
-
Interactive
Gabriel Goh · Distill · interactive
Worth it: Drag the step-size and momentum sliders and watch the path change on a real loss surface. You will feel why momentum helps, and when it overshoots.
-
Interactive
Parameter optimization in neural networks
deeplearning.ai · interactive
-
Read
An overview of gradient descent optimization algorithms
Sebastian Ruder
-
Read
Understanding Deep Learning, Ch 6 (SGD, momentum, Adam)
Simon Prince · free
-
Interactive
-
3.7 Weight initialisation; vanishing and exploding gradients
-
Watch
Building makemore Part 3: Activations & Gradients, BatchNorm
Andrej Karpathy
-
Interactive
deeplearning.ai · interactive
Worth it: Pick an initialisation and watch the activations and gradients shrink, explode or stay healthy layer by layer as the network trains.
-
Read
Understanding Deep Learning, Ch 7 (gradients and initialisation)
Simon Prince · free
- Read
-
Watch
-
3.8 Batch norm and layer norm
-
Watch
Building makemore Part 3 (the BatchNorm section)
Andrej Karpathy
-
Read
Understanding Deep Learning, Ch 11 (batch normalisation)
Simon Prince · free
-
Paper
Ba, Kiros, Hinton · arXiv · optional
-
Watch
-
3.9 Regularisation: dropout, weight decay, augmentation, early stopping
-
Read
Understanding Deep Learning, Ch 9 (regularisation)
Simon Prince · free
- Read
-
Read
-
3.10 PyTorch: nn.Module, DataLoader and the training loop
-
Watch
Andrej Karpathy
-
Read
PyTorch tutorials
Worth it: The official walk-through of exactly this loop, with tensors, datasets, models, autograd and saving, in runnable steps. The reference you will come back to.
-
Read
Dive into Deep Learning, Ch 6 (builders' guide)
d2l.ai · free
-
Watch
-
3.11 Convolutional networks: convolution, pooling, receptive field
-
Watch
3Blue1Brown
-
Interactive
Georgia Tech Polo Club · interactive
Worth it: Click any neuron of a real CNN and watch its filter slide across the image, step by step, with every number shown. The best way to see convolution happen.
- Read
-
Read
Understanding Deep Learning, Ch 10 (convolutional networks)
Simon Prince · free
-
Watch
-
3.12 Residual connections (ResNet)
-
Read
Understanding Deep Learning, Ch 11 (residual networks)
Simon Prince · free
-
Paper
Deep Residual Learning for Image Recognition (2015)
He et al. · arXiv · optional
-
Read
-
3.13 RNNs, and why long sequences are hard
-
Watch
Recurrent Neural Networks (RNNs), Clearly Explained
StatQuest (Josh Starmer)
-
Read
The Unreasonable Effectiveness of Recurrent Neural Networks
Andrej Karpathy
Worth it: A character RNN learns to write fake Shakespeare, Wikipedia and C code, with pictures of what single neurons track. Shows what these models can (and can't) do.
- Read
-
Watch
-
3.14 Embeddings: representing things as vectors
-
Watch
Building makemore Part 2: MLP (the embedding table)
Andrej Karpathy
-
Watch
Word Embedding and Word2Vec, Clearly Explained
StatQuest (Josh Starmer)
-
Interactive
TensorFlow · explore real embeddings in 3-D
-
Read
Jay Alammar · illustrated
Worth it: Colourful pictures of words turning into vectors and those vectors being trained. The clearest picture of what embeddings are and why they work.
-
Watch
-
3.15 Debugging training: overfit one batch, read loss curves
-
Read
A Recipe for Training Neural Networks
Andrej Karpathy
Worth it: The most useful blog post on training neural networks ever written: the exact step-by-step routine experts follow. Read it twice, and keep it open.
- Read
-
Read
Google Research
-
Read
-
3.16 LSTMs and GRUs: gates for long memory
-
Watch
Long Short-Term Memory (LSTM), Clearly Explained
StatQuest (Josh Starmer)
-
Read
Chris Olah · illustrated
Worth it: The diagrams everyone else copies: the cell state as a conveyor belt with gates along it. After this the four equations read like a picture.
-
Read
Dive into Deep Learning, Ch 10 (LSTM and GRU)
d2l.ai · free
-
Watch
Go deeper (optional)
-
Notes
Stanford CS231n notes and assignments Free
Backprop in NumPy by hand. Excellent practice.
-
Book
Maths plus PyTorch code for every idea. Use it as a reference.
-
Book
Neural Networks and Deep Learning (Michael Nielsen) Free
Gentle and patient. Use it if the main book feels too fast.
-
Blog
A Recipe for Training Neural Networks (Karpathy) Free
How to debug training. Read it twice.
-
Book
Deep Learning: Foundations and Concepts (Bishop and Bishop)
Advanced depth, written very carefully.