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.112 minBeing written
Tensors and Operations
Creating, indexing and reshaping tensors on CPU and GPU
Code: tensor exercises
- 1.212 minBeing written
Autograd
Automatic differentiation in PyTorch
Code: gradients by hand and by autograd
- 1.315 minBeing written
Building Models with nn.Module
Layers, parameters and forward methods
Code: a multi-layer network
- 1.412 minBeing written
Datasets and DataLoaders
Batching, shuffling and transforms
Code: a custom dataset
- 1.520 minBeing written
The Training Loop
Loss, optimiser, training and validation steps
Code: a complete training loop
Chapter 2 Training Deep Networks
- 2.120 minBeing written
Backpropagation in Detail
A full numerical example through a network
Code: verify gradients numerically
- 2.210 minBeing written
Weight Initialisation
Why it matters, and Xavier and He initialisation
Code: compare initialisations
Var(w) = 2 / n
- 2.312 minBeing written
Vanishing and Exploding Gradients
Causes, residual connections and gradient clipping
Code: diagnose a failing network
- 2.415 minBeing written
Regularisation in Deep Learning
Dropout, weight decay, data augmentation and early stopping
Code: reduce overfitting
- 2.512 minBeing written
Normalisation Layers
Batch, layer and group normalisation
Code: compare normalisations
- 2.610 minBeing written
Learning Rate Schedules
Warm-up, step and cosine schedules
Code: compare schedules
Chapter 3 Practical Deep Learning
- 3.115 minBeing written
Debugging Training
Overfitting one batch, checking loss curves and common bugs
Lab: fix five broken training runs
- 3.212 minBeing written
GPU Training and Mixed Precision
Using GPUs efficiently, and lower-precision arithmetic
Code: mixed-precision training
- 3.38 minBeing written
Saving, Loading and Checkpointing
Resuming training and sharing models
Code: checkpoint and resume
- 3.410 minBeing written
Keras, TensorFlow and JAX
Other frameworks compared
Code: the same model in Keras
- 3.520 minBeing written
Module Review and Assessment
Coding tasks and a scored quiz
Graded assessment