Skip to content

erfanmor/deep-learning-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Learning Models Collection

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.

Project Structure

  • 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-10
      • EfficientNet.ipynb: EfficientNet-based classifier (torchvision model) for CIFAR-10
      • ResNet.ipynb: ResNet (e.g., ResNet-18) implementation and training on CIFAR-10
  • MLP/: Fully-connected feed-forward networks for tabular data

    • MLP.ipynb: End-to-end notebook for training an MLP on a CSV dataset
    • SimpleMLP.py: Minimal MLP example (script form)
    • HyperparameterTuning/
      • GridSearch.py: Hyperparameter search using grid search for MLP
      • RandomSearch.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).

Requirements

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).

Datasets

  • CIFAR-10: Automatically downloaded via torchvision.datasets.CIFAR10 in CNN notebooks.
  • Airline Passengers: Loaded from RNN/data/airline-passengers.csv or 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.

Usage Notes

  • 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.

Results

CNN models

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%

RNN models

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

MLP model

Notebook Dataset Test Accuracy
MLP/MLP.ipynb MLP/db.csv (tabular) 83.49%

About

A curated collection of classic and modern deep learning models in PyTorch for educational purposes, including CNNs for images, RNNs for sequences, and MLPs for tabular data with end-to-end training and evaluation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors