PyTorch is the framework behind most current deep learning research and a large share of production models, including many of the open-weight language models people fine-tune today. This course goes below the high-level libraries to show how neural networks actually train: how gradients flow, why training goes wrong and how to fix it. You will build models from tensors up, including a small transformer, so the papers and model code you read afterwards make sense.
What you'll learn
- Tensors, shapes, broadcasting and devices
- Autograd: how PyTorch computes gradients, and writing a training loop by hand
- nn.Module, optimisers, loss functions and learning-rate schedules
- Datasets, DataLoaders and efficient input pipelines
- Convolutional networks for images, and residual connections
- Embeddings, attention and building a small transformer from scratch
- Regularisation: dropout, weight decay, normalisation and early stopping
- Training faster with GPUs, mixed precision and torch.compile
- Debugging training: overfitting a single batch, exploding gradients and data bugs
- Experiment tracking, reproducibility and exporting models for inference
Who it's for
- Developers and data scientists who know classical ML and want to understand deep learning properly
- ML engineers who use pretrained models and want to train or adapt their own
- Students preparing for research or deep learning engineering roles
Prerequisites
- Strong Python and NumPy skills
- Classical machine learning experience (see Machine Learning Fundamentals)
- Comfort with basic linear algebra and derivatives; we review what is needed
- Access to a GPU, local or cloud, for later modules
Outcomes
By the end of this course you will be able to:
- Write, train and evaluate neural networks in PyTorch without copying templates.
- Build CNNs and a small transformer and explain how each part works.
- Diagnose and fix common training failures.
- Train efficiently on GPUs and export models for use elsewhere.
Course outline
| Module | Topic |
|---|---|
| 1 | Tensors and devices |
| 2 | Autograd and gradient descent |
| 3 | Your first training loop |
| 4 | Modules, losses and optimisers |
| 5 | Data pipelines |
| 6 | Convolutional networks |
| 7 | Regularisation and normalisation |
| 8 | Embeddings and attention |
| 9 | A small transformer from scratch |
| 10 | GPUs, mixed precision and torch.compile |
| 11 | Debugging, tracking and reproducibility |
| 12 | Project: train and export a model for a real dataset |
FAQ
Why PyTorch rather than TensorFlow or JAX?
PyTorch is the most widely used framework in current research and open-source model work, and most model code you will meet is written in it. The concepts transfer to other frameworks.
Will I train a large language model?
You will train a small transformer to understand how they work. Adapting existing large models is covered in Fine-Tuning and Open-Weight LLMs.
How much maths do I need?
Enough to follow matrix multiplication and the idea of a derivative. We explain the rest as we go, with a focus on intuition and code.
How do I join?
Get in touch and we'll share the current format, schedule and enrolment details.