This project demonstrates the construction and training of a simple Convolutional Neural Network (CNN) for image classification using PyTorch. The goal is to build a model capable of classifying handwritten digits from the MNIST dataset. The MNIST dataset consists of 28x28 grayscale images of digits (0-9). This should help you get familiarized with the main concepts of machine learning as well as the basics of working with pytorch.
Follow these instructions to set up and run the project on your local machine. Once you have set up your environment, navigate to the pytorch_intro directory where you will be able to develop the CNN classification model and training pipeline. If you would like more practice before beginning, implement the linear regression and feed forward networks first. These will be simpler and will help you gain practice working with pytorch before you delve into the CNN.
- Python 3.11
-
Clone the repository:
git clone https://github.com/your-username/your-repository.git
-
Navigate to the project directory:
cd your-repository -
Create a virtual environment:
python3.11 -m venv venv
For Windows users:
python -m venv venv
-
Activate the virtual environment:
On Linux/macOS:
source venv/bin/activateOn Windows:
.\venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Install Jupyter Notebook (optional):
pip install jupyter
If you're planning to use Jupyter Notebook.
-
Create a Jupyter kernel (optional):
python -m ipykernel install --user --name=venv --display-name="Your Kernel Name"Replace "venv" with your virtual environment name and "Your Kernel Name" with the desired display name.
-
Deactivate the virtual environment when you're done:
deactivate