A simple pytorch tutorial for developing DNN models for a regression, a classification and a computer vision task.
The jupyter notebook of this tutorial exists on google colab and can be used without additional installation requirements. However, users need an existing google account and it is required to create a copy of the notebook in the users personal google drive, since global editing is not permitted in the main notebook. The link to the notebook can be found here: link
The code is also available from this repository in the pytorch_tutorial.ipynb
file. We recommend to use an anaconda environment to run the tutorial. An environment that contains all the packages needed can be installed from a command shell like this:
conda create --name tutorial_env python pandas matplotlib numpy scikit-learn seaborn pytables ipykernel
conda activate tutorial_env
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
Note that in the last command, the cudatoolkit
version needs to be adjusted to the supported CUDA version on the local machine.
We have also provided an tutorial_env.yml
file with a working environment that can be used to install the required software using anaconda
like this:
conda env create --name tutorial_env --file=tutorial_env.yml
Note that here we are using cudatoolkit
version 11.3
again, which might be different for other machines.
-
For regression task: WHO life expectancy dataset and California Housing Prices dataset
-
For classification task: Higgs dataset and the Breast Cancer Wisconsin (Diagnostic) dataset
-
For computer vision task: MNIST dataset and CIFAR10 dataset