This tutorial is designed to provide a hands-on introduction to the machine learning workflow using PyTorch. The focus is on building a simple Neural Network (NN) for image classification on the MNIST dataset, which consists of handwritten digits.
It is recommended to use Visual Studio Code or PyCharm to work with for this tutorial. Prerequisites:
- Python 3.8 or higher (3.11 is recommended) -> Download Python
- Create a virtual environment (venv) to avoid package conflicts.
python -m venv ./venv- Activate the virtual environment:
- On Windows:
.\venv\Scripts\activate
- On MacOS/Linux:
source ./venv/bin/activate - Install the required packages using the command:
pip install -r requirements.txt- Install Pytorch and torchvision the correct way for your system: Pytorch Installation if a NVIDIA GPU and CUDA is installed use the CUDA version, however it is not part of the turtotial to setup CUDA and it is not required to run the tutorial. It simply speeds up the training process.
There are four notebooks, each covering a different concept:
(Intro)0_MNIST_Basic: A basic Feed-Forward Neural Network(Turtorial)1_MNIST_Simple_CNN: Switches to a simple CNN(Addendum)2_MNIST_Data_Augmentation: Adds Data Augmentation(Addendum)3_MNIST_Deeper_Model: Adds more layers to get a Deeper Model
