Main Content

Quantization

Quantize the weights, biases, and activations of layers to reduced precision scaled integer data types

Use Deep Learning Toolbox™ together with the Deep Learning Toolbox Model Quantization Library support package to reduce the memory footprint and computational requirements of a deep neural network by quantizing the weights, biases, and activations of layers to reduced precision scaled integer data types. You can then generate C/C++, CUDA®, or HDL code from these quantized networks.

Functions

dlquantizerQuantize a deep neural network to 8-bit scaled integer data types
dlquantizationOptionsOptions for quantizing a trained deep neural network
calibrateSimulate and collect ranges of a deep neural network
validateQuantize and validate a deep neural network

Apps

Deep Network QuantizerQuantize a deep neural network to 8-bit scaled integer data types

Topics

Deep Learning Quantization

Quantization of Deep Neural Networks

Understand effects of quantization and how to visualize dynamic ranges of network convolution layers.

Quantization Workflow Prerequisites

Products required for the quantization of deep learning networks.

Quantization for GPU Target

Code Generation for Quantized Deep Learning Networks (GPU Coder)

Quantize and generate code for a pretrained convolutional neural network.

Quantize Residual Network Trained for Image Classification and Generate CUDA Code

This example shows how to quantize the learnable parameters in the convolution layers of a deep learning neural network that has residual connections and has been trained for image classification with CIFAR-10 data.

Quantize Object Detectors and Generate CUDA® Code

This example shows how to generate CUDA® code for an SSD vehicle detector and a YOLO v2 vehicle detector that performs inference computations in 8-bit integers.

Quantization for FPGA Target

Quantize Network for FPGA Deployment (Deep Learning HDL Toolbox)

This example shows how to quantize learnable parameters in the convolution layers of a neural network, and validate the quantized network.

Classify Images on an FPGA Using a Quantized DAG Network (Deep Learning HDL Toolbox)

In this example, you use Deep Learning HDL Toolbox™ to deploy a quantized deep convolutional neural network and classify an image.

Classify Images on FPGA by Using Quantized GoogLeNet Network (Deep Learning HDL Toolbox)

This example show how to use the Deep Learning HDL Toolbox™ to deploy a quantized GoogleNet network to classify an image.

Quantization for CPU Target

Code Generation for Quantized Deep Learning Networks (MATLAB Coder)

Quantize and generate code for a pretrained convolutional neural network.

Code Generation for Quantized Deep Learning Network on Raspberry Pi (MATLAB Coder)

Generate code for deep learning network that performs inference computations in 8-bit integers.

Featured Examples