Supported Layers for Quantization
R2026bThe 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
| Layer Block | MATLAB | GPU | FPGA |
|---|---|---|---|
imageInputLayer | |||
sequenceInputLayer | |||
featureInputLayer |
Convolution and Fully Connected Layers
Recurrent Layers
| Layer | MATLAB | GPU | FPGA |
|---|---|---|---|
lstmLayer | |||
gruLayer | |||
lstmProjectedLayer | |||
gruProjectedLayer |
Activation Layers
| Layer | MATLAB | GPU | FPGA |
|---|---|---|---|
reluLayer | |||
leakyReluLayer | |||
preluLayer | |||
clippedReluLayer | |||
tanhLayer | |||
swishLayer | |||
softmaxLayer | |||
sigmoidLayer | |||
dlhdl.layer.mishLayer (Deep Learning HDL Toolbox) |
Normalization Layers
| Layer | MATLAB | GPU | FPGA |
|---|---|---|---|
batchNormalizationLayer |
Utility Layers
| Layer | MATLAB | GPU | FPGA |
|---|---|---|---|
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.
Pooling Layers
Combination Layers
| Layer | MATLAB | GPU | FPGA |
|---|---|---|---|
additionLayer | |||
multiplicationLayer | |||
concatenationLayer | |||
depthConcatenationLayer |
See Also
dlquantizer | Deep Network
Quantizer