Files
pytorch-deep-learning/README.md
T

136 lines
10 KiB
Markdown
Raw Normal View History

2022-02-12 11:08:00 +10:00
# Learn PyTorch for Deep Learning (work in progress)
2022-02-12 11:05:17 +10:00
2021-10-19 10:51:09 +10:00
I'd like to learn PyTorch. So I'm going to use this repo to:
1. Add what I've learned.
2. Teach others in a beginner-friendly way.
2022-02-12 11:05:17 +10:00
Stay tuned to here for updates, course materials are being actively worked on.
2021-10-19 10:51:09 +10:00
Launch early 2022.
2022-02-12 11:05:17 +10:00
## Course materials/outline
2021-10-20 11:48:28 +10:00
2022-02-12 11:05:17 +10:00
* **Note:** This is rough and subject to change.
* **Course focus:** `code, code, code, experiment, experiment, experiment`
* **Teaching style:** [https://sive.rs/kimo](https://sive.rs/kimo)
2021-10-20 11:48:28 +10:00
2022-03-09 10:59:53 +10:00
| **Section** | **What does it cover?** | **Exercises & Extra-curriculum** | **Slides** |
2022-03-09 11:00:17 +10:00
| ----- | ----- | ----- | ----- |
2022-03-09 10:59:53 +10:00
| [00 - PyTorch Fundamentals](https://www.learnpytorch.io/00_pytorch_fundamentals/) | Many fundamental PyTorch operations used for deep learning and neural networks. | [Go to exercises & extra-curriculum](https://www.learnpytorch.io/00_pytorch_fundamentals/#exercises) | [Go to slides](https://github.com/mrdbourke/pytorch-deep-learning/blob/main/slides/00_pytorch_and_deep_learning_fundamentals.pdf) |
| [01 - PyTorch Workflow](https://www.learnpytorch.io/01_pytorch_workflow/) | Provides an outline for approaching deep learning problems and building neural networks with PyTorch. | [Go to exercises & extra-curriculum](https://www.learnpytorch.io/01_pytorch_workflow/#exercises) | [Go to slides](https://github.com/mrdbourke/pytorch-deep-learning/blob/main/slides/01_pytorch_workflow.pdf) |
2022-03-14 14:09:05 +10:00
| [02 - PyTorch Neural Network Classification](https://www.learnpytorch.io/02_pytorch_classification/) | Uses the PyTorch workflow from 01 to go through a neural network classification problem. | [Go to exercises & extra-curriculum](https://www.learnpytorch.io/02_pytorch_classification/#exercises) | [Go to slides](https://github.com/mrdbourke/pytorch-deep-learning/blob/main/slides/02_pytorch_classification.pdf) |
2022-03-24 15:33:15 +10:00
| [03 - PyTorch Computer Vision](https://www.learnpytorch.io/03_pytorch_computer_vision/) | Let's see how PyTorch can be used for computer vision problems using the same workflow from 01 & 02. | Go to exercises & extra-curriculum | Go to slides |
2022-03-09 10:59:53 +10:00
| Coming soon: 04 - PyTorch Custom Datasets | How do you load a custom dataset into PyTorch? Also we'll be laying the foundations in this notebook for our modular code (covered in 05). | Go to exercises & extra-curriculum | Go to slides |
| Coming soon: 05 - Going modular | PyTorch is designed to be modular, let's turn what we've created into a series of Python scripts (this is how you'll often find PyTorch code in the wild). | Go to exercises & extra-curriculum | Go to slides |
| Coming soon: 06 - PyTorch Transfer Learning | Let's take a well performing pre-trained model and adjust it to one of our own problems. | Go to exercises & extra-curriculum | Go to slides |
| Coming soon: 07 - Milestone Project 1: PyTorch Experiment Tracking | We've built a bunch of models... wouldn't it be good to track how they're all going? | Go to exercises & extra-curriculum | Go to slides |
| Coming soon: 08 - Milestone Project 2: PyTorch Paper Replicating | PyTorch is the most popular deep learning framework for machine learning research, let's see why by replicating a machine learning paper. | Go to exercises & extra-curriculum | Go to slides |
2021-10-20 15:50:59 +10:00
2022-02-12 11:05:17 +10:00
### Old outline version (will update this if necessary)
2022-01-28 12:17:11 +10:00
2021-10-20 11:48:28 +10:00
0. PyTorch fundamentals - ML is all about representing data as numbers (tensors) and manipulating those tensors so this module will cover PyTorch tensors.
1. PyTorch workflow - You'll use different techniques for different problem types but the workflow remains much the same:
```
data -> build model -> fit model to data (training) -> evaluate model and make predictions (inference) -> save & load model
```
2021-10-20 15:50:59 +10:00
Module 1 will showcase an end-to-end PyTorch workflow that can be leveraged for other problems.
2021-10-20 11:48:28 +10:00
2. PyTorch classification - Let's take the workflow we learned in module 1 and apply it to a common machine learning problem type: classification (deciding whether something is one thing or another).
2021-10-29 12:35:19 +10:00
3. PyTorch computer vision - We'll get even more specific now and see how PyTorch can be used for computer vision problems though still using the same workflow from 1 & 2. We'll also start functionizing the code we've been writing, for example: `def train(model, data, optimizer, loss_fn): ...`
2021-11-24 16:04:57 +10:00
4. PyTorch custom datasets - How do you load a custom dataset into PyTorch? Also we'll be laying the foundations in this notebook for our modular code (covered in 05).
5. Going modular - PyTorch is designed to be modular, let's turn what we've created into a series of Python scripts (this is how you'll often find PyTorch code in the wild). For example:
2021-10-20 11:48:28 +10:00
```
code/
2021-11-24 16:04:57 +10:00
data_setup.py <- sets up data
model_builder.py <- builds the model ready to be used
engine.py <- training/eval functions for the model
train.py <- trains and saves the model
2021-10-20 11:48:28 +10:00
```
2021-11-24 16:04:57 +10:00
6. PyTorch transfer learning - Let's improve upon the models we've built ourselves using transfer learning.
7. PyTorch experiment tracking - We've built a bunch of models... wouldn't it be good to track how they're all going?
2022-02-12 11:05:17 +10:00
8. PyTorch paper replicating - Let's see why PyTorch is the most popular deep learning framework for machine learning research by replicating a machine learning research paper with it.
2021-10-20 11:48:28 +10:00
2022-02-12 11:05:17 +10:00
Each notebook will teach a maximum of 3 big ideas.
2021-10-20 11:48:28 +10:00
2021-10-26 13:03:20 +10:00
## Status
2022-03-24 15:33:15 +10:00
* **Working on:** exercises and solutions for notebook 03
2022-03-12 16:14:11 +10:00
* **Total video count:** 90
* **Next:** annotate notebooks 03, 04, 05 with text then make slides and images
2021-12-08 11:17:03 +10:00
* **Done skeleton code for:** 00, 01, 02, 03, 04, 05, 06, 07
2022-03-24 15:28:41 +10:00
* **Done annotations (text) for:** 00, 01, 02, 03
* **Done images for:** 00, 01, 02, 03
2022-02-16 12:41:15 +10:00
* **Done keynotes for:** 00, 01, 02
2022-03-12 16:14:11 +10:00
* **Done vidoes for:** 00, 01, 02
2021-10-26 13:03:20 +10:00
2021-10-29 12:37:33 +10:00
## TODO
2022-01-31 09:25:55 +10:00
See the project page for specifics - https://github.com/users/mrdbourke/projects/1
2021-10-29 12:37:33 +10:00
High-level overview of things to do:
* How to use this repo (e.g. env setup, GPU/no GPU) - all notebooks should run fine in Colab and locally if needed.
2022-01-18 05:36:14 +10:00
* Finish skeleton code for notebooks 00 - 07 ✅
2021-11-24 16:04:57 +10:00
* Write annotations for 00 - 07
2022-01-28 12:17:11 +10:00
* Make images for 00 - 07
* Make slides for 00 - 07
2021-11-24 16:04:57 +10:00
* Record videos for 00 - 07
2021-10-29 12:37:33 +10:00
2021-10-19 10:51:09 +10:00
## Log
Almost daily updates of what's happening.
2022-03-24 15:28:41 +10:00
* 24 Mar 2022 - fix error for 03 not working in docs (finally)
* 23 Mar 2022 - add more images for 03
* 22 Mar 2022 - add images for 03
* 20 Mar 2022 - add more annotations for 03
* 18 Mar 2022 - add more annotations for 03
2022-03-17 13:10:49 +10:00
* 17 Mar 2022 - add more annotations for 03
* 16 Mar 2022 - add more annotations for 03
* 15 Mar 2022 - add more annotations for 03
2022-03-14 14:09:05 +10:00
* 14 Mar 2022 - start adding annotations for notebook 03, see the work in progress here: https://www.learnpytorch.io/03_pytorch_computer_vision/
* 12 Mar 2022 - recorded 12 videos for 02, finished section 02, now onto making materials for 03, 04, 05
* 11 Mar 2022 - recorded 9 videos for 02
* 10 Mar 2022 - recorded 10 videos for 02
* 9 Mar 2022 - cleaning up slides/code for 02, getting ready for recording
* 8 Mar 2022 - recorded 9 videos for section 01, finished section 01, now onto 02
* 7 Mar 2022 - recorded 4 videos for section 01
* 6 Mar 2022 - recorded 4 videos for section 01
* 4 Mar 2022 - recorded 10 videos for section 01
* 20 Feb 2022 - recorded 8 videos for section 00, finished section, now onto 01
* 18 Feb 2022 - recorded 13 videos for section 00
* 17 Feb 2022 - recorded 11 videos for section 00
* 16 Feb 2022 - added setup guide
* 12 Feb 2022 - tidy up README with table of course materials, finish images and slides for 01
* 10 Feb 2022 - finished slides and images for 00, notebook is ready for publishing: https://www.learnpytorch.io/00_pytorch_fundamentals/
* 01-07 Feb 2022 - add annotations for 02, finished, still need images, going to work on exercises/solutions today
* 31 Jan 2022 - start adding annotations for 02
* 28 Jan 2022 - add exercies and solutions for 01
* 26 Jan 2022 - lots more annotations to 01, should be finished tomorrow, will do exercises + solutions then too
* 24 Jan 2022 - add a bunch of annotations to 01
* 21 Jan 2022 - start adding annotations for 01
* 20 Jan 2022 - finish annotations for 00 (still need to add images), add exercises and solutions for 00
* 19 Jan 2022 - add more annotations for 00
* 18 Jan 2022 - add more annotations for 00
* 17 Jan 2022 - back from holidays, adding more annotations to 00
2021-12-10 11:35:48 +10:00
* 10 Dec 2021 - start adding annoations for 00
* 9 Dec 2021 - Created a website for the course ([learnpytorch.io](https://learnpytorch.io)) you'll see updates posted there as development continues
2021-12-08 11:17:03 +10:00
* 8 Dec 2021 - Clean up notebook 07, starting to go back through code and add annotations
* 26 Nov 2021 - Finish skeleton code for 07, added four different experiments, need to clean up and make more straightforward
2021-11-25 16:35:30 +10:00
* 25 Nov 2021 - clean code for 06, add skeleton code for 07 (experiment tracking)
2021-11-24 16:04:57 +10:00
* 24 Nov 2021 - Update 04, 05, 06 notebooks for easier digestion and learning, each section should cover a max of 3 big ideas, 05 is now dedicated to turning notebook code into modular code
2021-11-22 17:05:21 +10:00
* 22 Nov 2021 - Update 04 train and test functions to make more straightforward
2021-11-19 13:01:49 +10:00
* 19 Nov 2021 - Added 05 (transfer learning) notebook, update custom data loading code in 04
2021-11-19 10:43:32 +10:00
* 18 Nov 2021 - Updated vision code for 03 and added custom dataset loading code in 04
2021-11-12 15:10:49 +10:00
* 12 Nov 2021 - Added a bunch of skeleton code to notebook 04 for custom dataset loading, next is modelling with custom data
2021-11-12 15:09:47 +10:00
* 10 Nov 2021 - researching best practice for custom datasets for 04
2021-11-09 15:47:59 +10:00
* 9 Nov 2021 - Update 03 skeleton code to finish off building CNN model, onto 04 for loading custom datasets
2021-11-04 11:34:41 +10:00
* 4 Nov 2021 - Add GPU code to 03 + train/test loops + `helper_functions.py`
* 3 Nov 2021 - Add basic start for 03, going to finish by end of week
2021-10-29 12:35:19 +10:00
* 29 Oct 2021 - Tidied up skeleton code for 02, still a few more things to clean/tidy, created 03
2021-10-28 11:32:15 +10:00
* 28 Oct 2021 - Finished skeleton code for 02, going to clean/tidy tomorrow, 03 next week
2021-10-27 11:34:43 +10:00
* 27 Oct 2021 - add a bunch of code for 02, going to finish tomorrow/by end of week
2021-10-26 13:03:20 +10:00
* 26 Oct 2021 - update 00, 01, 02 with outline/code, skeleton code for 00 & 01 done, 02 next
2021-10-26 08:13:50 +10:00
* 23, 24 Oct 2021 - update 00 and 01 notebooks with more outline/code
2021-10-20 15:50:59 +10:00
* 20 Oct 2021 - add v0 outlines for 01 and 02, add rough outline of course to README, this course will focus on less but better
2021-10-19 13:27:43 +10:00
* 19 Oct 2021 - Start repo 🔥, add fundamentals notebook draft v0