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.

YesYesYes
GoogLeNet

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

YesYesYes
Caffe Network

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

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.

YesYesYes
Inception-v3

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

YesYesYes
Mobilenet-v2

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

YesYesYes
ResNet

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

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.

YesYesYes
VGG-16

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

YesYesYes
VGG-19

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

YesYesYes
Xception

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

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.

Layer NameDescriptioncuDNNTensorRTARM Compute Library for Mali GPU
additionLayer

Addition layer.

YesYesYes
averagePooling2dLayer

Average pooling layer.

YesYesYes
batchNormalizationLayer

Batch normalization layer.

YesYesYes
classificationLayer

Create classification output layer.

YesYesYes
clippedReluLayer

Clipped Rectified Linear Unit (ReLU) layer.

YesYesYes
convolution2dLayer

2-D convolution layer.

YesYesYes
crop2dLayer

Layer that applies 2-D cropping to the input.

YesYesNo
crossChannelNormalizationLayer

Channel-wise local response normalization layer.

YesYesYes
depthConcatenationLayer

Depth concatenation layer.

YesYesYes
dicePixelClassificationLayer

Pixel classification layer using generalized dice loss for semantic segmentation.

YesYesYes
dropoutLayer

Dropout layer.

YesYesYes
eluLayer

Exponential linear unit (ELU) layer.

YesYesNo
fullyConnectedLayer

Fully connected layer.

YesYesYes
globalAveragePooling2dLayer

Global average pooling layer for spatial data.

YesYesYes
groupedConvolution2dLayer

2-D grouped convolutional layer.

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
imageInputLayer

Image input layer.

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

YesYesYes
leakyReluLayer

Leaky Rectified Linear Unit (ReLU) layer.

YesYesYes
lstmLayer

Long short-term memory (LSTM) layer.

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

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

YesNoNo
maxPooling2dLayer

Max pooling layer.

YesYesYes
maxUnpooling2dLayer

Max unpooling layer.

YesYesNo
Output Layer

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
PixelClassificationLayer

Create pixel classification layer for semantic segmentation.

YesYesYes
regressionLayer

Create a regression output layer.

YesYesYes
reluLayer

Rectified Linear Unit (ReLU) layer.

YesYesYes
sequenceInputLayer

Sequence input layer.

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

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

YesNoNo
softmaxLayer

Softmax layer.

YesYesYes
tanhLayer

Hyperbolic tangent (tanh) layer.

YesYesYes
transposedConv2dLayer

Create a transposed 2-D convolution layer.

Code generation does not support asymmetric cropping of the input. For example, specifying a vector [t b l r] for the 'Cropping' parameter to crop the top, bottom, left, and right of the input is not supported.

YesYesYes
YOLOv2OutputLayer

Create output layer for YOLO v2 object detection network.

YesYesYes
YOLOv2ReorgLayer

Create reorganization layer for YOLO v2 object detection network.

YesYesYes
YOLOv2TransformLayer

Create transform layer for YOLO v2 object detection network.

YesYesYes
nnet.keras.layer.FlattenCStyleLayer

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

YesYesYes
nnet.keras.layer.GlobalAveragePooling2dLayer

Global average pooling layer for spatial data.

YesYesYes
nnet.keras.layer.SigmoidLayer

Sigmoid activation layer.

YesYesYes
nnet.keras.layer.TanhLayer

Hyperbolic tangent activation layer.

YesYesYes
nnet.keras.layer.ZeroPadding2dLayer

Zero padding layer for 2-D input.

YesYesYes
nnet.onnx.layer.ElementwiseAffineLayer

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

YesYesNo
nnet.onnx.layer.FlattenLayer

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

YesYesYes

Supported Classes

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

Layer NameDescriptioncuDNNTensorRTARM Compute Library for Mali GPU
yolov2ObjectDetector

Detect objects using YOLO v2 object detector

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

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

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

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

YesYesYes

See Also

Related Topics