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:

  1. Write, train and evaluate neural networks in PyTorch without copying templates.
  2. Build CNNs and a small transformer and explain how each part works.
  3. Diagnose and fix common training failures.
  4. Train efficiently on GPUs and export models for use elsewhere.

Course outline

ModuleTopic
1Tensors and devices
2Autograd and gradient descent
3Your first training loop
4Modules, losses and optimisers
5Data pipelines
6Convolutional networks
7Regularisation and normalisation
8Embeddings and attention
9A small transformer from scratch
10GPUs, mixed precision and torch.compile
11Debugging, tracking and reproducibility
12Project: 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.