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.

  1. Dive into Deep Learning, Multilayer perceptrons (hidden layers, activation functions) (opens in a new tab)

    Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola2026Book

    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.

  2. Dive into Deep Learning, Numerical stability and initialization (opens in a new tab)

    Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola2026Book

    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.

  3. Dive into Deep Learning, Dropout (opens in a new tab)

    Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola2026Book

    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.

  4. Dive into Deep Learning, From Fully Connected Layers to Convolutions (opens in a new tab)

    Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola2026Book

    For lesson 3, the argument for locality and weight sharing, and the price of the inductive bias, before you count shapes and parameters.

  5. Dive into Deep Learning, Backpropagation Through Time (opens in a new tab)

    Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola2026Book

    Next, backpropagation through time: why a long sequence means over a thousand matrix products, and why truncating it favours short-term effects.

  6. Dive into Deep Learning, Self-Attention and Positional Encoding (opens in a new tab)

    Aston Zhang, Zachary C. Lipton, Mu Li, Alexander J. Smola2026Book

    For lesson 4, self-attention with positional encoding, including why attention without positions cannot tell word order and why its cost is quadratic.

  7. torch.nn.functional.scaled_dot_product_attention (opens in a new tab)

    PyTorch2026Documentation

    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)

    PyTorch2026Documentation

    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)

    PyTorch2026Documentation

    How clipping by global norm is implemented, including the option that raises an error when the gradient norm is not finite.

Further reading

Research papers