Course Overview

Learn about the objectives, the prerequisites, and the intended audience for this course.

Why should you take this course?

There are so many PyTorch books, courses, and tutorials around, and its documentation is quite complete and extensive. So, why should you take this course?

First, this is not a typical course; most tutorials start with some nice and pretty image classification problems to illustrate how to use PyTorch. It may seem cool, but I believe it distracts you from learning how PyTorch works. Instead, this course will use a structured, incremental, and from-first principles approach to learning PyTorch.

Second, this is not a formal course in any way. This course has been written as if I was having a conversation with you, the reader.

You will be asked questions (and answers will be provided shortly afterward), and I’ll even make some (silly) jokes.

The main goal of this course is to make you understand the topic, so fancy mathematical notation will be avoided as much as possible and everything will be conveyed in plain English.

For this reason, you will be guided through the development of many models in PyTorch, and show you why PyTorch makes it much easier and more intuitive to build models in Python. Later we’ll explore concepts like autograd, dynamic computation graph, model classes, and, much more.

In addition, you will build, step-by-step, not only the models themselves but also your understanding of them. You’ll be shown both the reasoning behind the code and how to avoid some common pitfalls and errors along the way.

Another advantage of focusing on the basics is that this course will be useful even after PyTorch has been updated or replaced. It is fairly common for technical books and courses, especially those focusing on cutting-edge technology, to become quickly outdated. Hopefully, this is not going to be the case here. Since the underlying mechanics are not changing, then neither are the concepts. Some syntax will change over time, but backward-compatibility breaking changes are not expected to come anytime soon.

Intended audience

In general, this course has been designed for beginners but not only PyTorch beginners. We’ll also spend time explaining some fundamental concepts, which are essential to have a proper understanding of what is going on in the code.

The best example is gradient descent, which most people are familiar with at some level. Maybe you know its general idea, saw it in Andrew Ng’s Machine Learning course, or maybe you might have even computed some partial derivatives yourself!

In real life, the mechanics of gradient descent will be handled automatically by PyTorch. But, you will be able to walk through it anyway because many elements in the code and choices of hyper-parameters (learning rate, mini-batch size, etc.) can be much more easily understood if you know where they come from.

Maybe you already know some of these concepts well. If this is the case, you can simply skip them since these explanations have been made as independent as possible from the rest of the content.

But, I want to make sure everyone is on the same page. So, if you have just heard about a given concept or if you are unsure whether you have entirely understood it, these explanations are for you.


This is a course designed for beginners. So, as little prior knowledge as possible is needed. However, fundamental concepts will be explained whenever needed.

The only knowledge you’ll need is:

  • To be able to code in Python. If you are familiar with Object-Oriented Programming (OOP), that’s even better.

  • To be able to work with the PyData stack, including NumPy, matplotplib, and pandas, and Jupyter notebooks.

  • To be familiar with some basic Machine Learning concepts like:
    • Supervised learning: Regression and classification
    • Loss functions for regression and classification (Mean Squared Error, cross-entropy, etc.)
    • Training-validation-test split
    • Underfitting and overfitting (bias-variance trade-off)
    • Evaluation metrics (confusion matrix, accuracy, precision, recall, etc.)

Even so, some of the topics above will be briefly touched upon in the course, but there needs to be a line drawn somewhere; otherwise, this course would be gigantic!

There are several ways of running Jupyter notebooks; the setup for three of which have been discussed in the Appendix.

In this course, you will be provided with a workspace where you can easily access a Jupyter notebook.

Important things to know

In this course, there have been various icons used, each of which is used to communicate a variety of things. These can be seen below:


Potential problems or things to look out for.


Important things that need to be kept in mind.


Key aspects to remember.


Important information to pay attention to.


Technical aspects of parameterization or inner workings of algorithms.


Asking myself questions (pretending to be you) and answering them either in the same block or shortly after.


Important topics that will be covered later in more detail.


Jokes, puns, memes, or quotes from movies.

Files needed for the course

For people who want to test the code locally or on sites like Google Colab, you will need the following tarball to run the code without any issues:

Files tarball