Networks and Layers Supported for Code Generation
MATLAB®
Coder™ supports code generation for dlnetwork
(Deep Learning Toolbox), series, and directed acyclic graph (DAG) networks. You can generate
code for any trained neural network that uses supported deep
learning networks, layers and classes.
Supported Pretrained Networks
These pretrained networks, available in Deep Learning Toolbox™, are supported for code generation. You can use imagePretrainedNetwork
(Deep Learning Toolbox) function to load these
pretrained neural networks as dlnetwork
(Deep Learning Toolbox) objects for code generation.
Note that code generation does not support setting the name-value argument
Weights
of imagePretrainedNetwork
function to
"none"
. For example, use this code to load a pretrained GoogLeNet
neural network.
net = imagePretrainedNetwork("googlenet")
You can use analyzeNetworkForCodegen
to see if a network is compatible for code
generation for a specific deep learning library. For example:
result = analyzeNetworkForCodegen(imagePretrainedNetwork("googlenet"),TargetLibrary='none')
imagePretrainedNetwork Model Name Argument | Generic C/C++ | Intel® MKL-DNN and ARM® Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| Note The ARM Compute library is not supported for
| |
| ||
| ||
| ||
|
Supported Layers
These layers are supported for code generation for the target deep learning libraries specified in the table.
Note
In the following tables, the information icon indicates that the network, layer, or class has limited code generation capabilities. You might see errors and unexpected behavior. For more information, see the Extended Capabilities section on the page for that network, layer, or class.
Input Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
|
Convolution and Fully Connected Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
|
Note You can generate generic C/C++ code for channel-wise convolution when the number of groups is equal to the number of filter channels. | |
|
Sequence Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Activation Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
preluLayer (Deep Learning Toolbox) | ||
| ||
| ||
| ||
| ||
| ||
|
Normalization Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
|
Utility Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
|
Resizing Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
|
Pooling and Unpooling Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
adaptiveAveragePooling2dLayer (Deep Learning Toolbox) | ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| Note The ARM Compute library is not supported for
|
Combination Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
|
Transformer Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
|
Compute Vision and Image Processing Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
|
Custom Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
|
Custom Keras Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Custom ONNX Layers
Layer | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
Supported Classes
Class | Generic C/C++ | Intel MKL-DNN and ARM Compute Libraries |
---|---|---|
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|
See Also
imagePretrainedNetwork
(Deep Learning Toolbox) | analyzeNetworkForCodegen
Related Topics
- Pretrained Deep Neural Networks (Deep Learning Toolbox)
- List of Deep Learning Layers (Deep Learning Toolbox)
- Learn About Convolutional Neural Networks (Deep Learning Toolbox)
- Workflow for Deep Learning Code Generation with MATLAB Coder