Supported Networks and Layers

Supported Pretrained Networks

GPU Coder™ supports code generation for series and directed acyclic graph (DAG) convolutional neural networks (CNNs or ConvNets). You can generate code for any trained convolutional neural network whose layers are supported for code generation. See Supported Layers. You can train a convolutional neural network on either a CPU, a GPU, or multiple GPUs by using the Deep Learning Toolbox™ or use one of the pretrained networks listed in the table and generate CUDA® code.

Network NameDescriptioncuDNNTensorRTARM® Compute Library for Mali GPU
AlexNet

AlexNet convolutional neural network. For the pretrained AlexNet model, see alexnet.

The syntax alexnet('Weights','none') is not supported for code generation.

YesYesYes
Caffe Network

Convolutional neural network models from Caffe. For importing a pretrained network from Caffe, see importCaffeNetwork.

YesYesYes
Darknet-19

Darknet-19 convolutional neural network. For more information, see darknet19.

The syntax darknet19('Weights','none') is not supported for code generation.

YesYesYes
Darknet-53

Darknet-53 convolutional neural network. for more information, see darknet53.

The syntax darknet53('Weights','none') is not supported for code generation.

YesYesYes
DeepLab v3+

DeepLab v3+ convolutional neural network. For more information, see deeplabv3plusLayers.

YesYesNo
DenseNet-201

DenseNet-201 convolutional neural network. For the pretrained DenseNet-201 model, see densenet201.

The syntax densenet201('Weights','none') is not supported for code generation.

YesYesYes
GoogLeNet

GoogLeNet convolutional neural network. For the pretrained GoogLeNet model, see googlenet.

The syntax googlenet('Weights','none') is not supported for code generation.

YesYesYes
Inception-v3

Inception-v3 convolutional neural network. For the pretrained Inception-v3 model, see inceptionv3.

The syntax inceptionv3('Weights','none') is not supported for code generation.

YesYesYes
Inception-ResNet-v2

Inception-ResNet-v2 convolutional neural network. For the pretrained Inception-ResNet-v2 model, see inceptionresnetv2.

YesYesNo
Mobilenet-v2

MobileNet-v2 convolutional neural network. For the pretrained MobileNet-v2 model, see mobilenetv2.

The syntax mobilenetv2('Weights','none') is not supported for code generation.

YesYesYes
NASNet-Large

NASNet-Large convolutional neural network. For the pretrained NASNet-Large model, see nasnetlarge.

YesYesNo
NASNet-Mobile

NASNet-Mobile convolutional neural network. For the pretrained NASNet-Mobile model, see nasnetmobile.

YesYesNo
ResNet

ResNet-18, ResNet-50, and ResNet-101 convolutional neural networks. For the pretrained ResNet models, see resnet50, resnet18, and resnet101.

The syntax resnetXX('Weights','none') is not supported for code generation.

YesYesYes
SegNet

Multi-class pixelwise segmentation network. For more information, see segnetLayers.

YesYesNo
SqueezeNet

Small deep neural network. For the pretrained SqueezeNet models, see squeezenet.

The syntax squeezenet('Weights','none') is not supported for code generation.

YesYesYes
VGG-16

VGG-16 convolutional neural network. For the pretrained VGG-16 model, see vgg16.

The syntax vgg16('Weights','none') is not supported for code generation.

YesYesYes
VGG-19

VGG-19 convolutional neural network. For the pretrained VGG-19 model, see vgg19.

The syntax vgg19('Weights','none') is not supported for code generation.

YesYesYes
Xception

Xception convolutional neural network. For the pretrained Xception model, see xception.

The syntax xception('Weights','none') is not supported for code generation.

YesYesYes
YOLO v2

You only look once version 2 convolutional neural network based object detector. For more information, see yolov2Layers

YesYesYes

Supported Layers

The following layers are supported for code generation by GPU Coder for the target deep learning libraries specified in the table.

Once you install the support package GPU Coder Interface for Deep Learning Libraries, you can use coder.getDeepLearningLayers to see a list of the layers supported for a specific deep learning library. For example, coder.getDeepLearningLayers('cudnn') shows the list of layers supported for code generation by using the NVIDIA® cuDNN library.

Input Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

imageInputLayer

Deep Learning Toolbox

An image input layer inputs 2-D images to a network and applies data normalization.

Code generation does not support 'Normalization' specified using a function handle.

YesYesYes

sequenceInputLayer

Deep Learning Toolbox

A sequence input layer inputs sequence data to a network.

For code generation, only vector input types are supported. 2-D and 3-D image sequence input is not supported.

Code generation does not support 'Normalization' specified using a function handle.

YesYesNo

Convolution and Fully Connected Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

convolution2dLayer

Deep Learning Toolbox

A 2-D convolutional layer applies sliding convolutional filters to the input.

YesYesYes

groupedConvolution2dLayer

Deep Learning Toolbox

A 2-D grouped convolutional layer separates the input channels into groups and applies sliding convolutional filters. Use grouped convolutional layers for channel-wise separable (also known as depth-wise separable) convolution.

Code generation for the ARM Mali GPU is not supported for a 2-D grouped convolution layer that has the NumGroups property set as 'channel-wise' or a value greater than two.

YesYesYes

transposedConv2dLayer

Deep Learning Toolbox

A transposed 2-D convolution layer upsamples feature maps.

YesYesYes

fullyConnectedLayer

Deep Learning Toolbox

A fully connected layer multiplies the input by a weight matrix and then adds a bias vector.

YesYesNo

Sequence Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

sequenceInputLayer

Deep Learning Toolbox

A sequence input layer inputs sequence data to a network.

For code generation, only vector input types are supported. 2-D and 3-D image sequence input is not supported.

Code generation does not support 'Normalization' specified using a function handle.

YesYesNo

lstmLayer

Deep Learning Toolbox

An LSTM layer learns long-term dependencies between time steps in time series and sequence data.

For code generation, the StateActivationFunction property must be set to 'tanh'.

For code generation, the GateActivationFunction property must be set to 'sigmoid'.

YesYesNo

bilstmLayer

Deep Learning Toolbox

A bidirectional LSTM (BiLSTM) layer learns bidirectional long-term dependencies between time steps of time series or sequence data. These dependencies can be useful when you want the network to learn from the complete time series at each time step.

For code generation, the StateActivationFunction property must be set to 'tanh'.

For code generation, the GateActivationFunction property must be set to 'sigmoid'.

YesYesNo

flattenLayer

Deep Learning Toolbox

A flatten layer collapses the spatial dimensions of the input into the channel dimension.

YesNoNo

wordEmbeddingLayer

Text Analytics Toolbox™

A word embedding layer maps word indices to vectors.

YesYesNo

Activation Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

reluLayer

Deep Learning Toolbox

A ReLU layer performs a threshold operation to each element of the input, where any value less than zero is set to zero.

YesYesYes

leakyReluLayer

Deep Learning Toolbox

A leaky ReLU layer performs a threshold operation, where any input value less than zero is multiplied by a fixed scalar.

YesYesYes

clippedReluLayer

Deep Learning Toolbox

A clipped ReLU layer performs a threshold operation, where any input value less than zero is set to zero and any value above the clipping ceiling is set to that clipping ceiling.

YesYesYes

eluLayer

Deep Learning Toolbox

An ELU activation layer performs the identity operation on positive inputs and an exponential nonlinearity on negative inputs.

YesYesNo

tanhLayer

Deep Learning Toolbox

A hyperbolic tangent (tanh) activation layer applies the tanh function on the layer inputs.

YesYesYes

Normalization, Dropout, and Cropping Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

batchNormalizationLayer

Deep Learning Toolbox

A batch normalization layer normalizes each input channel across a mini-batch.

YesYesYes

crossChannelNormalizationLayer

Deep Learning Toolbox

A channel-wise local response (cross-channel) normalization layer carries out channel-wise normalization.

YesYesYes

dropoutLayer

Deep Learning Toolbox

A dropout layer randomly sets input elements to zero with a given probability.

YesYesYes

crop2dLayer

Deep Learning Toolbox

A 2-D crop layer applies 2-D cropping to the input.

YesYesYes

Pooling and Unpooling Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

averagePooling2dLayer

Deep Learning Toolbox

An average pooling layer performs down-sampling by dividing the input into rectangular pooling regions and computing the average values of each region.

YesYesYes

globalAveragePooling2dLayer

Deep Learning Toolbox

A global average pooling layer performs down-sampling by computing the mean of the height and width dimensions of the input.

YesYesYes

maxPooling2dLayer

Deep Learning Toolbox

A max pooling layer performs down-sampling by dividing the input into rectangular pooling regions, and computing the maximum of each region.

YesYesYes

globalMaxPooling2dLayer

Deep Learning Toolbox

A global max pooling layer performs down-sampling by computing the maximum of the height and width dimensions of the input.

YesYesYes

maxUnpooling2dLayer

Deep Learning Toolbox

A max unpooling layer unpools the output of a max pooling layer.

YesYesNo

Combination Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

additionLayer

Deep Learning Toolbox

An addition layer adds inputs from multiple neural network layers element-wise.

YesYesYes

depthConcatenationLayer

Deep Learning Toolbox

A depth concatenation layer takes inputs that have the same height and width and concatenates them along the third dimension (the channel dimension).

YesYesYes

concatenationLayer

Deep Learning Toolbox

A concatenation layer takes inputs and concatenates them along a specified dimension.

YesYesNo

Object Detection Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

anchorBoxLayer

Computer Vision Toolbox™

An anchor box layer stores anchor boxes for a feature map used in object detection networks.

YesYesYes

ssdMergeLayer

Computer Vision Toolbox

An SSD merge layer merges the outputs of feature maps for subsequent regression and classification loss computation.

YesYesNo

YOLOv2OutputLayer

Computer Vision Toolbox

Create output layer for YOLO v2 object detection network.

YesYesYes

YOLOv2ReorgLayer

Computer Vision Toolbox

Create reorganization layer for YOLO v2 object detection network.

YesYesYes

YOLOv2TransformLayer

Computer Vision Toolbox

Create transform layer for YOLO v2 object detection network.

YesYesYes

Output Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

softmaxLayer

Deep Learning Toolbox

A softmax layer applies a softmax function to the input.

YesYesYes

classificationLayer

Deep Learning Toolbox

A classification layer computes the cross entropy loss for multi-class classification problems with mutually exclusive classes.

YesYesYes

regressionLayer

Deep Learning Toolbox

A regression layer computes the half-mean-squared-error loss for regression problems.

YesYesYes

pixelClassificationLayer

Computer Vision Toolbox

A pixel classification layer provides a categorical label for each image pixel or voxel.

YesYesYes

dicePixelClassificationLayer

Computer Vision Toolbox

A Dice pixel classification layer provides a categorical label for each image pixel or voxel using generalized Dice loss.

YesYesYes

Output Layer

Deep Learning Toolbox

All output layers including custom classification or regression output layers created by using nnet.layer.ClassificationLayer or nnet.layer.RegressionLayer.

For an example showing how to define a custom classification output layer and specify a loss function, see Define Custom Classification Output Layer (Deep Learning Toolbox).

For an example showing how to define a custom regression output layer and specify a loss function, see Define Custom Regression Output Layer (Deep Learning Toolbox).

YesYesYes

Keras and ONNX Layers

Layer NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU

nnet.keras.layer.FlattenCStyleLayer

Deep Learning Toolbox

Flatten activations into 1-D assuming C-style (row-major) order.

YesYesYes

nnet.keras.layer.GlobalAveragePooling2dLayer

Deep Learning Toolbox

Global average pooling layer for spatial data.

YesYesYes

nnet.keras.layer.SigmoidLayer

Deep Learning Toolbox

Sigmoid activation layer.

YesYesYes

nnet.keras.layer.TanhLayer

Deep Learning Toolbox

Hyperbolic tangent activation layer.

YesYesYes

nnet.keras.layer.ZeroPadding2dLayer

Deep Learning Toolbox

Zero padding layer for 2-D input.

YesYesYes

nnet.onnx.layer.ElementwiseAffineLayer

Deep Learning Toolbox

Layer that performs element-wise scaling of the input followed by an addition.

YesYesYes

nnet.onnx.layer.FlattenLayer

Deep Learning Toolbox

Flattens the spatial dimensions of the input tensor to the channel dimensions.

YesYesYes

nnet.onnx.layer.IdentityLayer

Deep Learning Toolbox

Layer that implements ONNX identity operator.

YesYesYes

Supported Classes

The following classes are supported for code generation by GPU Coder for the target deep learning libraries specified in the table.

NameProductDescriptioncuDNNTensorRTARM Compute Library for Mali GPU
yolov2ObjectDetector

Computer Vision Toolbox

Detect objects using YOLO v2 object detector

  • Only the detect method of the yolov2ObjectDetector is supported for code generation.

  • The roi argument to the detect method must be a codegen constant (coder.const()) and a 1x4 vector.

  • Only the Threshold, SelectStrongest, MinSize, MaxSize, and MiniBatchSize Name-Value pairs are supported.

  • The height, width, channel, and batch size of the input image must be fixed size.

  • The minimum batch size value passed to detect method must be fixed size.

  • The labels output is returned as a cell array of character vectors, such as {'car','bus'}.

YesYesYes
ssdObjectDetector

Computer Vision Toolbox

Object to detect objects using the SSD-based detector.

  • Only the detect method of the ssdObjectDetector is supported for code generation.

  • The roi argument to the detect method must be a codegen constant (coder.const()) and a 1x4 vector.

  • Only the Threshold, SelectStrongest, MinSize, MaxSize, and MiniBatchSize Name-Value pairs are supported. All Name-Value pairs must be compile-time constants.

  • The channel and batch size of the input image must be fixed size.

  • The labels output is returned as a categorical array.

  • In the generated code, the input is rescaled to the size of the input layer of the network. But the bounding box that the detect method returns is in reference to the original input size.

  • The bounding boxes might not numerically match the simulation results.

YesYesNo

See Also

| | | | | | |

Related Topics