Skip to content

KinGeorge/CIFAR10-Pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LICENSE

Architecture

├── cnn
  ├── README.md                              // Introduction of CNN model.
  ├── src
  │   ├──dataset.py                          // Dataset loader to feed into model.
  │   ├──cnn_for_train.py                    // CNN train model architecture.
  │   ├──cnn.py                              // CNN architecture.
  |   ├──config.py                           // Parser arguments
  ├── utils
  │   ├──log.py                              // log for all the lines in terminal.
  │   ├──plot.py                             // plot loss and accuracy graph.
  ├── scripts
  │   ├──exe.sh                              // shell script for training with our model.
  │   ├──exe_alex.sh                         // shell script for training with Alexnet(Baseline).
  │   ├──exe_res.sh                          // shell script for training with Resnet34(Best Result).
  ├── train.py                               // Train API entry.

Train CIFAR10 with Torch

This is a very simple framework that can try our provided model or test your own PyTorch model on CIFAR10.

It’s easy to use and flexible at the same time.

Requirement

Our experiments are conducted under these environments:

Operating System Device Torch
Ubuntu 20.04 NVIDIA GeForce RTX 3090*1, Cuda:11.5 1.11.0+cu113
Ubuntu 20.04 NVIDIA GeForce RTX 2080Ti*1, Cuda:11.3 1.10.0+cu113

You can first alter the configuration such as the device and some hyperparameters in the config.py.

We highly recommend you to use the bash scripts to simply run

cd [Your Path]/cnn
sh scripts/exe.sh

or you can run by

cd [Your Path]/cnn
python train.py

The Model will be stored in the checkpoint folder if the testing accuracy is bigger than the threshold accuracy(default: 80) which you can define in the config.py.

We offer 3 types of bash scripts for you to try, which the hyper-parameters are tuned and the result is the same in our report.

Benchmark

Model(mode) Test Acc
Ours(0) 84.950
LeNet(1) 72.800
AlexNet(2) 78.090
GoogleNet(3) 84.120
Resnet18(4) 83.810
Resent34(w pretrian)(5) 96.620
DenseNet(w pretrian)(6) 86.810

Configuration of our simple CNN model will be discusses in the report.

Resnet34 are finetuned with 35 epochs with learning rate 1e-5.

Other models are running under default setting in config.py.

All the result is in folder appendix to see our full result.

Releases

No releases published

Packages

No packages published