# Quant

Research code implementing least-squares binary quantization of neural networks in PyTorch, with configs and scripts for reproducing the paper's MNIST, CIFAR-100 and ImageNet results.

This repository is a PyTorch implementation of a published method for least-squares binary quantization of neural networks, released to let others reproduce the paper's results. It targets Python 3.6 or newer and installs from source into a virtual environment.

A command-line interface runs training on MNIST, CIFAR-100 or ImageNet using YAML configuration files that document the important parameters, and an existing experiment can be resumed or re-evaluated without retraining by pointing at its saved directory. For CIFAR-100, a full-precision teacher model is trained first, and a quantized student model is then trained against that teacher's checkpoint. Every experiment's configuration, metrics, model checkpoints and TensorBoard logs are saved together under a named experiment directory, with the current date and time used as the name if none is given.

Website: https://github.com/apple-aiml-research/ml-quant
