8000 GitHub - oooolga/IFT6390_Project
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

oooolga/IFT6390_Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IFT6390_Project

Contact Information

Olga (Ge Ya) Xu

olga.xu823@gmail.com

Dependencies

  • torchvision==0.2.0
  • matplotlib==2.2.2
  • six==1.11.0
  • torch.egg==info
  • tqdm==4.23.0
  • numpy==1.14.2
  • Pillow==5.3.0
  • torch==0.4.1.post2

Documents

Code Setup

git clone https://github.com/oooolga/IFT6390_Project.git
cd IFT6390_Project
mkdir saved_models results

Train Models

python main.py ...
  usage: main.py [-h] [-lr LEARNING_RATE] [--batch_size BATCH_SIZE]
               [--test_batch_size TEST_BATCH_SIZE] [--epochs EPOCHS]
               [--seed SEED] [--weight_decay WEIGHT_DECAY] --model_name
               MODEL_NAME [--load_model LOAD_MODEL] [--optimizer {Adam,SGD}]
               [--dataset {CIFAR,FMNIST,EMNIST}] [--model {CNN,NN,Regression}]
               [--plot_freq PLOT_FREQ]

optional arguments:
  -h, --help            show this help message and exit
  -lr LEARNING_RATE, --learning_rate LEARNING_RATE
                        Learning rate.
  --batch_size BATCH_SIZE
                        Mini-batch size for training.
  --test_batch_size TEST_BATCH_SIZE
                        Mini-batch size for testing.
  --epochs EPOCHS       Total number of epochs.
  --seed SEED           Random number seed.
  --weight_decay WEIGHT_DECAY
                        Weight decay.
  --model_name MODEL_NAME
                        Model name.
  --load_model LOAD_MODEL
                        Load model path.
  --optimizer {Adam,SGD}
                        Optimizer type.
  --dataset {CIFAR,FMNIST,EMNIST}
                        Dataset choice.
  --model {CNN,NN,Regression}
                        Model type.
  --plot_freq PLOT_FREQ
                        plot_freq

Training Examples

Training a CNN model on CIFAR with SGD

python main.py -lr 0.01 --epochs 100 --weight_decay 5e-4 --model_name CIFAR_CNN --model CNN --optimizer SGD --dataset CIFAR

Model type: CNN
Dataset: CIFAR
Optimizer type: SGD
Learning rate: 0.01
Total number of epochs: 100
Learning rate: 0.01
Weight decay: 0.0005
Batch size: 50
Plot frequency: 5

Training CIFAR by loading a pre-trained model

python main.py -lr 0.01 --epochs 100 --weight_decay 5e-4 --model_name CIFAR_CNN --model CNN --optimizer SGD --dataset CIFAR --load_model saved_models/CIFAR_CNN.pt

Evaluate

python evaluate.py ...
  usage: evaluate.py [-h] [--dataset {CIFAR,FMNIST,EMNIST}]
                   [--model {CNN,NN,Regression}] --load_model LOAD_MODEL
                   [--batch_size BATCH_SIZE]

optional arguments:
  -h, --help            show this help message and exit
  --dataset {CIFAR,FMNIST,EMNIST}
                        Dataset choice.
  --model {CNN,NN,Regression}
                        Model type.
  --load_model LOAD_MODEL
                        Load model path.
  --batch_size BATCH_SIZE
                        Mini-batch size for testing.

Evaluate Examples

Evaluate a trained CIFAR CNN model

python evaluate.py --dataset CIFAR --model CNN --load_model saved_models/CIFAR_CNN.pt 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages

0