Main Content

Supported Layers for Quantization

The deep neural network layers supported for the quantization workflow depend on the choice of execution environment for the quantization workflow. The target hardware associated with each execution environment determines the supported networks and layers for that environment.

For more information about the quantization workflow and choosing an execution environment, see Quantization of Deep Neural Networks.

Two types of support for layers are:

  • Layers supported in the quantization workflow -- These layers can exist in your network when using the quantization workflow for each execution environment. A layer supported in the quantization workflow may not have its parameters quantized in the workflow.

  • Layers that can be quantized -- This is a subset of the layers supported in the quantization workflow. These layers can have their parameters quantized in the workflow.

To determine which layers in your network can be quantized, analyze your network for compression in the Deep Network Designer app.

Networks and Layers Supported in the Quantization Workflow

These layers can exist in your network for the quantization workflow. For additional details about support for the layers, see Considerations for Supported Layers for Quantization.

  • MATLAB® — Supports all layers in the Deep Learning Toolbox™. For a list of layers, see List of Deep Learning Layers.

  • GPU — Supports networks and layers that support code generation for the CUDA® Deep Neural Network library (cuDNN). For a list of these networks and layers, see Supported Networks, Layers, and Classes (GPU Coder).

  • FPGA — Supports networks and layers that support code generation for Xilinx® and Intel® FPGA and SoC devices. For a list of these networks and layers, see Supported Networks, Boards, and Tools (Deep Learning HDL Toolbox).

  • CPU — Supports networks and layers that support code generation for the ARM® Compute Library. For a list of these networks and layers, see Networks and Layers Supported for Code Generation (MATLAB Coder).

Layers That Can Be Quantized

This table lists the layers that can be quantized. For details about additional considerations for support for particular layers and architectures, see Considerations for Supported Layers for Quantization.

For a list of layers that can be quantized for the CPU execution environment, see Generate int8 Code for Deep Learning Networks (MATLAB Coder).

Activation Layers

Note

These input layer normalizations correspond to the Normalization property of an imageInputLayer, featureInputLayer, or sequenceInputLayer layer in your network.

Normalization, Dropout, and Cropping Layers

LayerMATLABGPUFPGA
batchNormalizationLayer 
crop2dLayer  
dlhdl.layer.reshapeLayer (Deep Learning HDL Toolbox)  
dlhdl.layer.sliceLayer (Deep Learning HDL Toolbox)  
dlhdl.layer.splitLayer (Deep Learning HDL Toolbox)  
resize2dLayer (Image Processing Toolbox)  

Note

batchNormalizationLayer and dropoutLayer layers can be quantized if you use the prepareNetwork function during the quantization workflow. For more information, see Considerations for Supported Layers for Quantization.

Sequence Layers

LayerMATLABGPUFPGA
flattenLayer 
lstmLayer  
lstmProjectedLayer  

See Also

|

Topics