Learn the basics of training a simple PyTorch model using a structured and incremental approach. We will use Google Colab and work our way together into building and training a model in PyTorch.
The main goal of this session is to introduce you to the basic building blocks needed for training a model in PyTorch. At the end of it, you should be familiar with PyTorch's key components and how to assemble them together into a working model.
This session offers a brief overview of the content in the first volume of my series of books, "Deep Learning with PyTorch Step-by-Step". You can find it on Amazon (paperback and Kindle) or Gumroad (PDF).
Open it in Google Colab TrainingYourFirstModelinPyTorch.ipynb.
If you'd rather use a local environment, please follow these steps (assuming you use Anaconda):
-
Install GraphViz: https://www.graphviz.org/
-
Create a conda environment:
conda create -n pytorch101 pip conda python==3.8.5
-
Activate the conda environment:
conda activate pytorch101
-
Install PyTorch: https://pytorch.org/get-started/locally/
-
Install other packages:
conda install scikit-learn==0.23.2 matplotlib==3.3.2 jupyter==1.0.0 ipywidgets==7.5.1 plotly==4.14.3 -c anaconda
-
Clone this repo:
git clone https://github.com/dvgodoy/AnalyticsVidhya_DataHour_PyTorch.git
-
Start Jupyter:
jupyter notebook