Intermediate level · Module 1 of 6 · 15 guided hours
PyTorch in Depth
Write well-structured PyTorch code: tensors and autograd, custom datasets and loaders, and reusable training loops with checkpoints.
Learning objectives
- Use tensors, devices and autograd confidently
- Write custom Dataset classes and use DataLoader
- Structure training code with configuration, logging and checkpoints
Topics
- tensors, shapes and devices
- autograd and computational graphs
- Dataset and DataLoader
- transforms
- training and evaluation loops
- checkpoints and resuming
Lessons
-
Lesson 1 Tensors, Devices and Autograd
Master tensor operations, move work between CPU and GPU, and understand how autograd computes gradients.
tensor shape and dtypedevice (CPU/GPU)autogradtorch.no_grad
-
Lesson 2 Datasets and DataLoaders
Load data from folders or files with custom Dataset classes and efficient DataLoaders.
Dataset __len__ and __getitem__DataLoadertransforms pipelineshuffling
-
Lesson 3 Structuring Training Code
Organise training into reusable functions with configuration, logging and checkpoints.
train and evaluate functionsconfiguration filelogging metricscheckpoint (model + optimiser + epoch)
Practical activity
Refactor a notebook-only training script into a small project with a dataset class, a training module, a configuration file and checkpointing.
Expected outcomes
- Reusable, debuggable training code
- Reliable long training runs
Assessment
Code review against a checklist plus a demonstration of resuming training from a checkpoint.
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.