Deep learning with PyTorch: from tensors to real models

Write the training loop yourself, then build image and text models with PyTorch 2, transfer learning and solid experiment habits

7 ratings 2,560 students Sample

Created by Fatima Idrissi

  • Updated September 2026
  • English
  • Intermediate

What you will learn

  • Manipulate tensors and run computations on CPU, CUDA or MPS devices
  • Explain how autograd computes gradients and how optimisers use them
  • Write a complete training and evaluation loop from scratch
  • Build convolutional networks and fine tune pretrained models
  • Train a simple text classifier with embeddings
  • Diagnose training problems and track experiments reproducibly

Course content

6 sections, 24 lessons, 4h 13m total

Tensors, gradients and the training loop 5 lessons · 53 min
  • Video: What deep learning is good at Preview 8 min
  • Article: Tensors and devices Preview 13 min
  • Article: Autograd: how gradients are computed 13 min
  • Article: Models with nn.Module and the training loop 14 min
  • Quiz: Check your understanding 5 min
Data pipelines 3 lessons · 32 min
  • Video: Datasets and DataLoaders 12 min
  • Video: Transforms and augmentation 11 min
  • Article: Splits, seeds and reproducibility 9 min
Convolutional networks for images 4 lessons · 48 min
  • Video: How convolutions work 12 min
  • Video: Building and training a CNN 13 min
  • Video: Transfer learning with pretrained models 13 min
  • Video: Looking inside: errors and saliency 10 min
Training like a practitioner 4 lessons · 42 min
  • Video: Optimisers and learning rates 11 min
  • Video: Regularisation and early stopping 10 min
  • Video: Mixed precision and torch.compile 10 min
  • Video: Debugging training runs 11 min
Text and sequences 4 lessons · 45 min
  • Video: From text to tensors 10 min
  • Video: Embeddings and a bag of embeddings classifier 11 min
  • Video: A first look at attention and transformers 12 min
  • Video: Fine tuning a small pretrained text model 12 min
Experiments and deployment basics 4 lessons · 33 min
  • Article: Tracking experiments 9 min
  • Video: Saving and loading models 9 min
  • Video: Inference on new data 10 min
  • Quiz: Final check 5 min

Requirements

  • Comfortable with Python and NumPy
  • Basic machine learning concepts such as train and validation splits
  • Optional: access to a GPU or a free cloud notebook

Description

PyTorch is the most widely used framework for deep learning research and a large share of production work. It is flexible and feels like ordinary Python, which makes it a great tool for learning how neural networks really work.

In this course we do not start with a one line fit call. We start with tensors and gradients, write a training loop by hand and understand every step. Then we build real models: an image classifier, a fine tuned pretrained network and a small text classifier, using the habits that make deep learning projects reproducible and debuggable.

What you will learn

  • Tensors, broadcasting and running code on a GPU or Apple Silicon
  • Autograd and how gradients drive learning
  • Building models with nn.Module and training them with your own loop
  • Datasets, DataLoaders and data augmentation
  • Convolutional networks for images
  • Transfer learning with pretrained models from torchvision
  • Embeddings and a simple text classifier
  • Regularisation, learning rate schedules, mixed precision and torch.compile
  • Experiment tracking, checkpoints and debugging training runs

Before you start

You should be comfortable with Python and NumPy and know basic machine learning ideas such as training and validation splits, overfitting and evaluation metrics. A GPU is helpful but not required: every exercise runs on a laptop CPU with smaller settings, and a free cloud notebook works for the larger ones.

Who this course is for

  • Developers and data scientists moving into deep learning
  • ML practitioners who have only used high level APIs
  • Students who want to understand neural networks properly

Instructor

Fatima Idrissi

Machine learning engineer teaching scikit-learn, PyTorch and modern NLP from the ground up

  • 4.4 instructor rating
  • 21 reviews
  • 7,660 students
  • 3 courses
  • Sample

I build and evaluate machine learning models, mostly for text and tabular data. My work covers the whole loop: preparing data, training baselines, trying deep learning when it is worth it, and measuring whether the model actually helps.

In my courses I start with the simplest model that could work and only add complexity when the numbers justify it. You will write the training loop yourself before using higher level tools, so nothing feels like magic.

I also enjoy reading papers and turning the useful parts into small, runnable notebooks.

View profile

Student reviews

4.4 7 ratings
5 star 57%
4 star 29%
3 star 14%
2 star 0%
1 star 0%
Jin W. Sep 30, 2026
Sample

Shapes, shapes, shapes

The habit of printing shapes after every step fixed most of my early bugs. Great teaching.

Benjamin F. Sep 21, 2026
Sample

The training loop finally makes sense

Writing the loop by hand and then breaking it on purpose taught me more than any high level API.

Aiko N. Aug 23, 2026
Sample

Excellent transfer learning section

Fine tuning ResNet on a small plant dataset gave great results with very little data.

Ricardo L. Jul 20, 2026
Sample

Thorough and practical

Autograd explained from first principles was great. The text section felt a bit shorter than the image one.

Fatou S. Jun 15, 2026
Sample

Debugging lesson is gold

Overfitting one batch as a sanity check has already saved me from two broken pipelines.

Oskar W. May 13, 2026
Sample

Good on modern features

Mixed precision and torch.compile were explained clearly with honest speed comparisons.

Deepa R. Mar 25, 2026
Sample

Needs a GPU for comfort

Everything runs on CPU, but some exercises are slow. A cloud notebook made it much better.

$74.99 Enroll now
SampleSample catalog: the instructors, courses, reviews and stats on this site are demo content.