Implementation for paper "Latent Weights Do Not Exist: Rethinking Binarized Neural Network Optimization"
- Python version
3.6
or3.7
- Tensorflow version
1.14+
or2.0.0
- Larq version
0.2.0
- Zookeeper version
0.1.1
You can also check out one of our prebuilt docker images.
This is a complete Python module. To install it in your local Python environment, cd
into the folder containing setup.py
and run:
pip install -e .
To train a model locally, you can use the cli:
bnno train binarynet --dataset cifar10
To reproduce the runs exploring various hyperparameters, run:
bnno train binarynet \
--dataset cifar10 \
--preprocess-fn resize_and_flip \
--hparams-set bop \
--hparams threshold=1e-6,gamma=1e-3
where you use the appropriate values for threshold and gamma.
To achieve the accuracy in the paper of 91.3%, run:
bnno train binarynet \
--dataset cifar10 \
--preprocess-fn resize_and_flip \
--hparams-set bop_sec52 \
--epochs 500
To achieve the accuracy in the paper of 54.2%, run:
bnno train birealnet --dataset imagenet2012 --hparams-set bop --epochs 100