This repository contain the code implementation for COM 3031 Computational Intelligence assignment. Using Pytorch for implementation of a deep neural network for image classification task on CIFAR-10 dataset and compare a result of a model trained on different types of optimizers that are
- Gradient based optimizaton (gradient descent)
- Metaheuristic optimization (GA, PSO and Memetic)
Metaheuristic optimizer was implemented using Deap library.
Grade: 93/100.
Report : Link to report folder
-
Wish Suharitdamrong
-
Taimoor Rizwan
-
Ionut Boston
There are two ways of installing package using conda
1.Create virtual conda environment from environment.yml
2.Use conda and pip to install a pakages
# Create virtual environment from .yml file
conda env create -f environment.yml
# activate virtual environment
conda activate ci
Use Anaconda virtual environment to install all dependencies
# create virtual environment
conda create -n ci
# activate virtual environment
conda activate ci
conda install pytorch torchvision torchaudio -c pytorch
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip install -r requirement.txt
├── ckpt # checkpoint of a pretrain model
│ └── CIFAR-10_GD_SGD.pth
python train_gd.py # Use gradient descent to train whole network
python train_ga.py # Use genetic algorithms to train whole network
python train_pso.py # Use particle swarm optimization to train whole network
python train_hybrid_*.py # All the fiels start with train_hybrid are two stage training
python train_meme.py # Train two stage with memetic algorithms
python train_nsga.py # Train two stage with NSGA II algorithms
jupyter notebook plot.ipynb
Tensordboard --logdir=../CI_logs