Module resources
Deep learning and transformers
Checked sources to go further than the lessons. Back to the module.
Recommended learning sequence
Work through these in order.
Start with the textbook chapter on hidden layers and activation functions. It shows why stacked affine layers collapse into one and gives the sigmoid and tanh derivatives that lesson 1 builds on.
Dive into Deep Learning, Numerical stability and initialization (opens in a new tab)
Then read how vanishing and exploding gradients arise and why equal initial weights never break symmetry. Read it beside the lesson 1 table of initialisations.
Dive into Deep Learning, Dropout (opens in a new tab)
For lesson 2, the textbook account of dropout: how survivors are rescaled so the expected activation is unchanged, and why it is switched off at evaluation.
Dive into Deep Learning, From Fully Connected Layers to Convolutions (opens in a new tab)
For lesson 3, the argument for locality and weight sharing, and the price of the inductive bias, before you count shapes and parameters.
Dive into Deep Learning, Backpropagation Through Time (opens in a new tab)
Next, backpropagation through time: why a long sequence means over a thousand matrix products, and why truncating it favours short-term effects.
Dive into Deep Learning, Self-Attention and Positional Encoding (opens in a new tab)
For lesson 4, self-attention with positional encoding, including why attention without positions cannot tell word order and why its cost is quadratic.
torch.nn.functional.scaled_dot_product_attention (opens in a new tab)
Close with the library function for scaled dot-product attention, to compare its default scale and masking options with the formula in lesson 4.
All resources
Official documentation
torch.nn.init (opens in a new tab)
The exact standard deviations PyTorch uses for Xavier and Kaiming initialisation, including the ReLU gain of the square root of 2, to check against the lesson 1 derivation.
torch.nn.utils.clip_grad_norm_ (opens in a new tab)
How clipping by global norm is implemented, including the option that raises an error when the gradient norm is not finite.
Further reading
Dive into Deep Learning, Residual Networks (ResNet) and ResNeXt (opens in a new tab)
The textbook view of residual blocks: let the layers fit the residual so that doing nothing is easy, and how a 1 by 1 convolution reshapes the shortcut.
Dive into Deep Learning, Fine-Tuning (opens in a new tab)
The four-step fine-tuning recipe with a worked hot dog example. Read it before you plan how to freeze or fine-tune a pretrained backbone.
Research papers
Understanding the difficulty of training deep feedforward neural networks (opens in a new tab)
The paper that found the logistic sigmoid poorly suited to deep networks with random initialisation. Read the abstract and the discussion of saturation.
Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour (opens in a new tab)
The source for warmup and a learning-rate scaling rule when the batch size grows. Useful when you change the batch size without changing the rate.
On the difficulty of training Recurrent Neural Networks (opens in a new tab)
The analysis of exploding and vanishing gradients in recurrent networks, and the proposal to clip the gradient norm. Read it after the lesson 3 section on gradients through time.
An Empirical Exploration of Recurrent Network Architectures (opens in a new tab)
An empirical comparison of recurrent architectures, including the finding that a forget-gate bias of 1 closes the gap between the LSTM and the GRU. Abstract page only.
Neural Machine Translation of Rare Words with Subword Units (opens in a new tab)
How byte pair encoding was adapted for translation so that rare and unseen words become sequences of smaller units.
Training language models to follow instructions with human feedback (opens in a new tab)
The InstructGPT paper behind the lesson 4 overview of supervised fine-tuning and learning from ranked answers. Read the abstract and the reward-model loss in section 3.5.
Survey of Hallucination in Natural Language Generation (opens in a new tab)
A survey that defines hallucination in text generation. Read section 2 before you decide how to measure it for your own task.