Beginner Level Deep Learning Tutorials in Pytorch!
Note that these tutorials expect some knowledge of deep learning concepts. While some of the concepts are explained we are mainly focusing on (in detail) how to implement them in python with Pytorch.
I have compiled a list of additional resources that cover many of the concepts we look at, the YouTube series section are incredibly valuable!
If you have any good resources let me know and I can add them!
If you can't find an explanation on something you want to know let me know and i'll try to find it!
Some level of basic Python programming knowledge is expected.
More sections to come!
Let me know if you want to see anything else!
Help support this work!
Donate here!
https://www.buymeacoffee.com/lukeditria
Corresponding Videos
Reinforcement Learning Youtube Playlist
Let me know if you want to see a video on any particular section!
Discord Server
Get help in my Discord Server
Installing
These notebooks need Python 3.10 or newer. Let's set up a virtual environment so everything stays in one place and doesn't mess with anything else on your computer!
git clone https://github.com/LukeDitria/pytorch_tutorials.git
cd pytorch_tutorials
python -m venv .venv
Now activate it (you'll need to do this every time you open a new terminal)
# Linux / Mac
source .venv/bin/activate
# Windows
.venv\Scripts\activate
Then install the libraries and start Jupyter!
pip install -r requirements.txt
jupyter lab
A few things that might trip you up:
-
If you have an NVIDIA GPU, make sure you install the version of PyTorch that matches your CUDA version. The PyTorch install page will give you the right command, run it before
pip install -r requirements.txt. Newer GPUs (like the RTX 50 series) need a recent CUDA build. -
The notebooks that use
torchtext(Sections 12, 13 and 14, plus Semantic Clustering) were made with an older version of PyTorch astorchtextis no longer being updated. For those, make a second virtual environment with Python 3.11 and runpip install torch==2.1.0 torchtext==0.16.0 "numpy<2" pandas tqdm portalockeras well as the other libraries you need (torchtextwill installtorchdatafor you). -
The Procgen notebook (Section 11) needs
procgenwhich doesn't install on newer versions of Python, you'll need an older environment for it too. -
A few notebooks need a dataset you have to download yourself, the notebook will tell you where to get it and where to put it (Section 8 needs CUB-200 from Kaggle, Section 14's image captioning needs COCO).
-
Some of the notebooks take a very long time to train, they were run on a big GPU for hours (or days!). You don't need to run them to the end to follow along, but you may want to lower the number of epochs.
Contents (So Far!)
Section 0 -> Python basics that will be expected knowledge
Section 1 -> Implementing some basic Machine Learning Algorithms in Python with Numpy
Section 2 -> Pytorch intro and basics, basic Machine Learning Algorithms with Pytorch
Section 3 -> Multi-Layer Perceptron (MLP) for Classification and Non-Linear Regression
Section 4 -> Pytorch Convolutions and CNNs
Section 5 -> Pytorch Transfer Learning
Section 6 -> Pytorch Tools and Training Techniques
Applications + Advanced
Section 7 -> Pytorch Autoencoders and Representation Learning
Section 8 -> Pytorch Bounding Box Detection and Image Segmentation
Section 9 -> Pytorch Image Generation
Section 10 -> Pytorch Trained Model Interpretation
Section 11 -> Pytorch Reinforcement Learning
Sequential Data
Section 12 -> Using Sequential Data
Section 13 -> All about Attention
Section 14 -> Transformer Time
Contents (In Progress!)
Section 15 -> Deploying Models
Section 16 -> Advanced Applications
Contents (To Come!)
Folder layout:
notebooks -> Tutorials and Skeleton code (Start here)
solutions -> Skeleton code Solutions
data -> Data and Images
