All courses

Advanced · module A5

Deep Learning with PyTorch

By the end: Build and train networks in PyTorch, diagnose training problems, and train efficiently on a GPU

Covers
Building, training and debugging deep networks in PyTorch
Contents
3 chapters, 16 topics
Time
About 4 hours
Level
Advanced
Your progress
0 / 16

This module builds on Neural Networks and Deep Learning Essentials, Advanced Mathematics for AI. We suggest looking at it first, but the choice is yours.

Chapter 1 PyTorch Fundamentals

  1. 1.1

    Tensors and Operations

    Creating, indexing and reshaping tensors on CPU and GPU

    Code: tensor exercises

    12 minBeing written
  2. 1.2

    Autograd

    Automatic differentiation in PyTorch

    Code: gradients by hand and by autograd

    12 minBeing written
  3. 1.3

    Building Models with nn.Module

    Layers, parameters and forward methods

    Code: a multi-layer network

    15 minBeing written
  4. 1.4

    Datasets and DataLoaders

    Batching, shuffling and transforms

    Code: a custom dataset

    12 minBeing written
  5. 1.5

    The Training Loop

    Loss, optimiser, training and validation steps

    Code: a complete training loop

    20 minBeing written

Chapter 2 Training Deep Networks

  1. 2.1

    Backpropagation in Detail

    A full numerical example through a network

    Code: verify gradients numerically

    20 minBeing written
  2. 2.2

    Weight Initialisation

    Why it matters, and Xavier and He initialisation

    Code: compare initialisations

    Var(w) = 2 / n

    10 minBeing written
  3. 2.3

    Vanishing and Exploding Gradients

    Causes, residual connections and gradient clipping

    Code: diagnose a failing network

    12 minBeing written
  4. 2.4

    Regularisation in Deep Learning

    Dropout, weight decay, data augmentation and early stopping

    Code: reduce overfitting

    15 minBeing written
  5. 2.5

    Normalisation Layers

    Batch, layer and group normalisation

    Code: compare normalisations

    12 minBeing written
  6. 2.6

    Learning Rate Schedules

    Warm-up, step and cosine schedules

    Code: compare schedules

    10 minBeing written

Chapter 3 Practical Deep Learning

  1. 3.1

    Debugging Training

    Overfitting one batch, checking loss curves and common bugs

    Lab: fix five broken training runs

    15 minBeing written
  2. 3.2

    GPU Training and Mixed Precision

    Using GPUs efficiently, and lower-precision arithmetic

    Code: mixed-precision training

    12 minBeing written
  3. 3.3

    Saving, Loading and Checkpointing

    Resuming training and sharing models

    Code: checkpoint and resume

    8 minBeing written
  4. 3.4

    Keras, TensorFlow and JAX

    Other frameworks compared

    Code: the same model in Keras

    10 minBeing written
  5. 3.5

    Module Review and Assessment

    Coding tasks and a scored quiz

    Graded assessment

    20 minBeing written