../_images/logo-quic-on@h68.png

AIMET Examples

AIMET Examples provide reference code (in the form of Jupyter Notebooks) to learn how to apply AIMET quantization and compression features. It is also a quick way to become familiar with AIMET usage and APIs.

For more details on each of the features and APIs please refer: Links to User Guide and API Documentation

Browse the notebooks

The following table has links to browsable versions of the notebooks for different features. | Model Quantization Examples

Features

PyTorch

TensorFlow

Keras

Quantization-Aware Training (QAT)

Link

Link

QAT with Range Learning

Link

Link

Cross-Layer Equalization (CLE)

Link

Link

Link

Adaptive Rounding (AdaRound)

Link

Link

Link

AutoQuant

Link

Link

BN Re-estimation

Link


Model Compression Examples

Features

PyTorch

TensorFlow

Channel Pruning

Link

Link

Spatial SVD

Link

Link

Spatial SVD + Channel Pruning

Link

Link


Running the notebooks

Install Jupyter

  • Install the Jupyter metapackage as follows (pre-pend with “sudo -H” if appropriate):

python3 -m pip install jupyter

  • Start the notebook server as follows (please customize the command line options if appropriate):

jupyter notebook –ip=* –no-browser &

  • The above command will generate and display a URL in the terminal. Copy and paste it into your browser.

Run the notebooks

  • Navigate to one of the following paths under the Examples directory and launch your chosen Jupyter Notebook (.ipynb extension): - Examples/torch/quantization/ - Examples/torch/compression/ - Examples/tensorflow/quantization/ - Examples/tensorflow/compression/

  • Follow the instructions therein to execute the code.