Learn PyTorch for Deep Learning: Zero to Mastery

The Zero to Mastery PyTorch course is live! Get started with machine learning hands-on by writing PyTorch code.

learnpytorch.io cover image detailing all of the different sections of the Learn PyTorch for Deep Learning course
Get all of the course materials in a beautiful interactive book at learnpytorch.io

Short version

The Zero to Mastery PyTorch course, taught by myself, is live and available.

Longer version

The best way to learn is by doing.

And that's just what we'll do in the Learn PyTorch for Deep Learning: Zero to Mastery course.

We'll learn by doing.

Throughout 200+ hands-on videos, we'll go through many of the most important concepts in machine learning and deep learning by writing PyTorch code.

If you're new to machine learning, consider the course a momentum builder.

By the end, you'll be comfortable navigating the PyTorch documentation, reading PyTorch code, writing PyTorch code, searching for things you don't understand and building your own machine learning projects.

What's PyTorch?

PyTorch is a machine learning framework written in the Python programming language.

It allows you to write machine learning algorithms capable of turning data into models into intelligence.

Why learn PyTorch?

As of July 2022, 58% of machine learning research papers with code available use PyTorch. And this number has been growing since PyTorch’s release.

In essence, machine learning researchers love PyTorch.

And typically, industry follows research.

So if all of the best machine learning research is coming out in PyTorch, knowing PyTorch is a fantastic way to start working in machine learning.

What are the prerequisites?

Bad: "I can't learn it" (that's bulls***).

Good: Three to six months of experience writing Python code and a willingness to learn (you're more than ready to go).

The course is as beginner-friendly as possible.

So if you've got more than one year's experience with machine learning, you might learn a few things but the materials are designed for beginners.

How's the course taught?

The focus of the course is code, code, code, experiment, experiment, experiment.

There's a reason two of the course mottos are:

If in doubt, run the code!
Experiment, experiment, experiment!

We'll write code together, apprenticeship style.

Meaning in the video version of the course, I'll write PyTorch code and explain it and then you'll follow along by writing the same code.

If we get stuck on something, we'll search for an answer.

You'll notice I leave many of my errors in the videos, this is on purpose.

Because errors happen (often) and being able to troubleshoot them is important.

I'm a big fan of there being no speed limit to learning something.

So that's what we'll be doing.

Learning by coding.

Learning by experimenting.


What's inside the course?

You can view and read all of the materials online for free at learnpytorch.io.

The video version of the course is available by signing up for the Learn PyTorch for Deep Learning course on the Zero to Mastery Academy.

But let's get specific.

The course is comprised of 10 modules (or notebooks), best taken sequentially (but feel free to jump around).

00 – PyTorch Fundamentals

We'll start from the ground up.

Answering questions like what is PyTorch (an open-source machine learning framework) and what can PyTorch be used for (manipulating data and writing machine learning algorithms).

Then we'll get familiar with the fundamental building block of deep learning, the tensor.

A tensor is a numerical representation of data (where data can be almost anything, images, text, tables of numbers).

And the whole goal of machine learning is to find patterns in data.

So knowing how to create, interact with and manipulate tensors is paramount.

learnpytorch.io home page for PyTorch fundamentals section of learn PyTorch for deep learning zero to mastery course
All of the course materials are available to read in an interactive online book at learnpytorch.io 

01 – PyTorch Workflow

The idea of machine learning is to turn data into intelligence.

And the machine learning model that's able to do that the best is the winner.

So how do you go from data to model to intelligence with PyTorch?

That's what PyTorch Workflow focuses on:

  1. Preparing data (turning it into tensors).
  2. Building or picking a pretrained model (to suit your problem).
  3. Fitting the model to the data (or letting the model find patterns in the data).
  4. Evaluating the trained model (after it's learned patterns in data).
  5. Improving the model through experimentation.
  6. Saving and reloading a trained model (so you can export it and use it in applications).

We'll use and build upon this workflow throughout the course.

A PyTorch Workflow with six steps from data preparation to saving and reloading a trained model.
The PyTorch WorkFlow we'll cover and build upon throughout the Learn PyTorch for Deep Learning course.

02 – PyTorch Neural Network Classification

Neural networks are one of, if not the most powerful kind of machine learning algorithms.

They're what power many of today's most advanced artificial intelligence (AI) systems such as search and self-driving cars.

But can you get a neural network to do something simple like classifying whether a dot is red or blue?

A simple problem, yes, but experimenting with toy problems is one of the best ways to learn machine learning.

In doing so, we'll go through all of the major steps for one of the most common machine learning problems, classification: building a neural network to predict if something is one thing or another.

03 – PyTorch Computer Vision

Neural networks changed the game of computer vision forever.

And now PyTorch drives many of the latest advancements in computer vision algorithms.

Tesla uses PyTorch to build their computer vision algorithms for their self-driving software.

Apple uses PyTorch to build models that computationally enhance photos taken with the iPhone.

In PyTorch Computer Vision, we'll write PyTorch code to create a neural network capable of seeing patterns in images and classifying them into different categories.

04 – PyTorch Custom Datasets

The magic of machine learning is building algorithms to find patterns in your own custom data.

There are plenty of existing datasets out there, but how do load your own custom dataset into PyTorch to build models to find patterns in it?

Perhaps you'd like to build a security system for your home and you'd like to teach it what your family looks like so it recognizes them.

Or perhaps you'd like to build an application capable of classifying the different dog photos you take.

That’s exactly what PyTorch Custom Datasets covers, we'll create our own custom dataset with food images of pizza, steak and sushi to start the major project of the course: FoodVision.

05 – PyTorch Going Modular

The whole point of PyTorch is to be able to write Pythonic machine learning code.

And there are two main tools for writing machine learning code with Python:

  1. Jupyter/Google Colab notebooks (great for experimenting).
  2. Python scripts (great for reproducibility and modularity).

In PyTorch Going Modular we'll take our most useful Jupyter/Google Colab Notebook code and turn it into reusable Python scripts (this is often how you’ll find PyTorch code shared in the wild).

We'll reuse these Python scripts throughout the rest of the sections in the course.

A workflow for writing machine learning code in PyTorch, start in Jupyter notebooks and then move to Python scripts
A workflow for writing machine learning code: start with experiments in Jupyter/Google Colab Notebooks and then move the most useful code to Python scripts. This concept is covered in section 05 PyTorch Going Modular.

06 – PyTorch Transfer Learning

Transfer learning is easily my favourite subject in machine learning and deep learning.

It enables you to take what one model has learned and apply it to your own problem(s).

In PyTorch Transfer Learning, we'll take a powerful computer vision model, one that's already learned patterns in a large dataset of images and adapt it to work with our own FoodVision Mini project.

We'll see how leveraging an already existing machine learning model is one of the best ways to get fantastic results with minimal resources and time.

07 – Milestone Project 1: PyTorch Experiment Tracking

The first milestone project of the course.

At this point, we'll have built plenty of PyTorch models.

But we've been tracking our progress in a way that's okay for a few models but could get out of hand when running multiple experiments.

So if we're following the machine learning practitioner’s motto of experiment, experiment, experiment!

How can we keep track of which model performs the best?

That’s where PyTorch Experiment Tracking comes in.

We'll set up a system to programmatically track and save several FoodVision Mini experiment results and then compare them to find the best.

08 – Milestone Project 2: PyTorch Paper Replicating

The field of machine learning advances quickly.

New research papers get published every day.

Being able to read and understand these papers takes time and practice.

So that’s what we'll be going through in PyTorch Paper Replicating.

We’ll read through a machine learning research paper together and replicate it with PyTorch code.

And by the end of this second milestone project, we’ll have replicated the groundbreaking Vision Transformer computer vision architecture for our FoodVision Mini problem.

turning a series of images, math and text into usable code
In 08. PyTorch Paper Replicating, we'll be turning the original Vision Transformer paper (comprised of images, math and text) into usable PyTorch code.

09 – Milestone Project 3: PyTorch Model Deployment

By the final milestone project of the course, our FoodVision Mini model will be performing quite well.

But up until now, no one else has been able to access it but us.

The PyTorch Model Deployment section answers the question: "how do we get our FoodVision Mini model into the hands of others?"

We'll go through the steps of how to take the best performing FoodVision Mini model and deploy it to the web so other people can access it and try it out with their own food images.

Can't I learn all of this myself?


You can.

There's a reason I'm calling this course the second best place on the internet to learn PyTorch.

Because the best place is the PyTorch documentation.

Though documentation can be a little intimidating when you first encounter it.

So this course structures things in a way that's a fun warmup before diving into the documentation.

Got another question?

Feel free to email me or leave a discussion on the course GitHub repository.

Otherwise, happy machine learning and I'll see you in the course.

Let's code!