/dorefa-cifar100

Pytorch Implementation of DoreFa-Net with CIFAR100 dataset

Primary LanguagePython

Pytorch CIFAR100 + DoReFa

This is a Pytorch implementation of DoreFa with CIFAR-100 dataset.

Installation

Use git clone to run this project.

git clone https://github.com/phuocphn/dorefa-cifar100

Usage

Train full precision baseline model.

mkdir logs
python main.py --bit 32 \
--log_name resnet18_w32a32-ceres-01 \
--arch resnet18 --wd 5e-4 \
--max_epochs 250 >> logs/resnet18_w32a32-ceres-01.txt

Train W2A2 model.

mkdir logs
 python main.py --bit 2 \
--log_name resnet18_w2a2-ceres-01 \
--arch resnet18 --wd 5e-4 \
--max_epochs 250 >> logs/resnet18_w2a2-ceres-01.txt

Train W4A4 model.

mkdir logs
python main.py --bit 4 \
--log_name resnet18_w4a4-ceres-01 \
--arch resnet18 --wd 5e-4 \
--max_epochs 250 >> logs/resnet18_w4a4-ceres-01.txt

Results

(Quantized models are trained from scratch.)

Model Top@1 Accuracy
FP32 76.00
W4A4 76.20
W2A2 74.02

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT