Vector Quantized Neural Network (VQNN) for pytorch This is the pytorch version for the VQ-NN code, fro AlexNet and ResNet models
Please install torch and torchvision by following the instructions at: http://pytorch.org/
python main_quantized.py --model resnet --save temp_path --dataset cifar10 --quantize identical
To run resnet18 for cifar10 with Binary Connection:
python main_quantized.py --model resnet_quantized --save temp_path --dataset cifar10 --quantize BC
To run resnet18 for cifar10 with Binary Neural Networks:
python main_quantized.py --model resnet_quantized --save temp_path --dataset cifar10 --quantize BNN
To run resnet18 for cifar10 with Vector Quantization, similar to HSQ:
python main_quantized.py --model resnet --save temp_path --dataset cifar10 --quantize VQ
python main_quantized.py --model resnet --model-config "{'depth': 50}" --save temp_path --dataset imagenet --quantize identical
python main_quantized.py --model alexnet --save temp_path --dataset imagenet --quantize identical
python main_quantized.py --model resnet --save temp_path --dataset cifar10 --quantize VQ --user_vq_optim true