This repository contains a curated collection of deep learning models implemented in PyTorch and organized by architecture family. It is designed as a learning and experimentation playground for classic and modern neural network models on common benchmark datasets.
-
CNN/: Convolutional Neural Networks for image classification
- Classic/
AlexNet.ipynb: AlexNet-style CNN for CIFAR-10 (with training, evaluation, and accuracy reporting)LeNet.ipynb: LeNet-style CNN on a simple image dataset (e.g., MNIST-like)VGG.ipynb: VGG-style deep CNN for image classification
- Modern/
DenseNet.ipynb: DenseNet implementation and training pipeline on CIFAR-10EfficientNet.ipynb: EfficientNet-based classifier (torchvision model) for CIFAR-10ResNet.ipynb: ResNet (e.g., ResNet-18) implementation and training on CIFAR-10
- Classic/
-
MLP/: Fully-connected feed-forward networks for tabular data
MLP.ipynb: End-to-end notebook for training an MLP on a CSV datasetSimpleMLP.py: Minimal MLP example (script form)- HyperparameterTuning/
GridSearch.py: Hyperparameter search using grid search for MLPRandomSearch.py: Hyperparameter search using random search for MLP
db.csv: Example tabular dataset used in MLP examples
-
RNN/: Recurrent Neural Networks for sequence data
GRU.ipynb: GRU-based text classification model on IMDB reviews (sentiment analysis)LSTM.ipynb: LSTM-based time-series forecasting on airline passengers data- data/
airline-passengers.csv: Time-series data for the LSTM example
-
.gitignore: Git ignore rules including data folders (e.g.,
CNN/Classic/data/,CNN/Modern/data/, and other generated artifacts).
All examples are implemented in Python using PyTorch and common scientific Python libraries. A typical environment will include:
- Python 3.10+ (or similar modern version)
- PyTorch
- torchvision
- numpy, pandas
- scikit-learn
- matplotlib
- jupyter / jupyterlab
- transformers and datasets (for the GRU IMDB example)
You can manage dependencies using a virtual environment (e.g., venv, conda, or poetry).
- CIFAR-10: Automatically downloaded via
torchvision.datasets.CIFAR10in CNN notebooks. - Airline Passengers: Loaded from
RNN/data/airline-passengers.csvor via direct URL in some examples. - IMDB: Loaded using
datasets.load_dataset("imdb")from the Hugging Face Datasets library. - Tabular MLP Data: Provided in
MLP/db.csv.
Some data directories (such as raw downloads or intermediate artifacts) are ignored by Git, as configured in .gitignore.
- The focus of this repository is educational: each notebook is structured to be readable and step-by-step, including data loading, model definition, training loop, and evaluation.
- Training settings (epochs, batch size, learning rate) are chosen to provide a reasonable trade-off between runtime and accuracy, and you are encouraged to modify them for further experiments.
- GPU support is enabled when available via
torch.cuda.is_available(); otherwise, models fall back to CPU.
For all CIFAR-10 experiments, the number of epochs is intentionally kept low to save time, because the primary goal is to demonstrate model implementations rather than to achieve state-of-the-art accuracy. As a result, the reported accuracies should not be used for serious performance comparison.
| Notebook | Dataset | Test Accuracy |
|---|---|---|
CNN/Classic/LeNet.ipynb |
MNIST | 98.60% |
CNN/Classic/AlexNet.ipynb |
CIFAR-10 | 74.24% |
CNN/Classic/VGG.ipynb |
CIFAR-10 | 77.45% |
CNN/Modern/ResNet.ipynb (e.g., ResNet-18) |
CIFAR-10 | 81.19% |
CNN/Modern/DenseNet.ipynb |
CIFAR-10 | 81.60% |
CNN/Modern/EfficientNet.ipynb |
CIFAR-10 | 64.72% |
| Notebook | Dataset | RMSE | MAE |
|---|---|---|---|
RNN/GRU.ipynb |
Time-series style evaluation | 19.99 | 17.00 |
RNN/LSTM.ipynb |
Airline Passengers time series | 42.64 | 34.96 |
| Notebook | Dataset | Test Accuracy |
|---|---|---|
MLP/MLP.ipynb |
MLP/db.csv (tabular) |
83.49% |