Hauptinhalt

Supported Layers for Quantization

R2026b

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.

Input Layers

Recurrent Layers

Activation Layers

Normalization Layers

LayerMATLABGPUFPGA
batchNormalizationLayer

Utility Layers

LayerMATLABGPUFPGA
dropoutLayer
spatialDropoutLayer
flattenLayer 
crop2dLayer  
scalingLayer  
identityLayer
reshapeLayer 
permuteLayer 
sliceLayer  
formatLayer 
depthToSpace2dLayer (Image Processing Toolbox)  
spaceToDepthLayer (Image Processing Toolbox) 
resize2dLayer (Image Processing Toolbox)  
dlhdl.layer.reshapeLayer (Deep Learning HDL Toolbox)  
dlhdl.layer.sliceLayer (Deep Learning HDL Toolbox)  
dlhdl.layer.splitLayer (Deep Learning HDL Toolbox)  

Note

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

See Also

|

Topics