supported networks, layers, and classes -凯发k8网页登录

main content

supported networks, layers, and classes

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 (deep learning toolbox).

the syntax alexnet('weights','none') is not supported for code generation.

yes

yes

yes

caffe network

convolutional neural network models from caffe. for importing a pretrained network from caffe, see (deep learning toolbox).

yes

yes

yes

darknet-19

darknet-19 convolutional neural network. for more information, see (deep learning toolbox).

the syntax darknet19('weights','none') is not supported for code generation.

yes

yes

yes

darknet-53

darknet-53 convolutional neural network. for more information, see (deep learning toolbox).

the syntax darknet53('weights','none') is not supported for code generation.

yes

yes

yes

deeplab v3

deeplab v3 convolutional neural network. for more information, see (computer vision toolbox).

yes

yes

no

densenet-201

densenet-201 convolutional neural network. for the pretrained densenet-201 model, see (deep learning toolbox).

the syntax densenet201('weights','none') is not supported for code generation.

yes

yes

yes

efficientnet-b0

efficientnet-b0 convolutional neural network. for the pretrained efficientnet-b0 model, see (deep learning toolbox).

the syntax efficientnetb0('weights','none') is not supported for code generation.

yesyesyes

googlenet

googlenet convolutional neural network. for the pretrained googlenet model, see (deep learning toolbox).

the syntax googlenet('weights','none') is not supported for code generation.

yes

yes

yes

inception-resnet-v2

inception-resnet-v2 convolutional neural network. for the pretrained inception-resnet-v2 model, see (deep learning toolbox).

yes

yes

no

inception-v3

inception-v3 convolutional neural network. for the pretrained inception-v3 model, see (deep learning toolbox).

the syntax inceptionv3('weights','none') is not supported for code generation.

yes

yes

yes

mobilenet-v2

mobilenet-v2 convolutional neural network. for the pretrained mobilenet-v2 model, see (deep learning toolbox).

the syntax mobilenetv2('weights','none') is not supported for code generation.

yes

yes

yes

nasnet-large

nasnet-large convolutional neural network. for the pretrained nasnet-large model, see (deep learning toolbox).

yes

yes

no

nasnet-mobile

nasnet-mobile convolutional neural network. for the pretrained nasnet-mobile model, see (deep learning toolbox).

yes

yes

no

resnet

resnet-18, resnet-50, and resnet-101 convolutional neural networks. for the pretrained resnet models, see (deep learning toolbox), (deep learning toolbox), and (deep learning toolbox).

the syntax resnetxx('weights','none') is not supported for code generation.

yes

yes

yes

segnet

multi-class pixelwise segmentation network. for more information, see (computer vision toolbox).

yes

yes

no

squeezenet

small deep neural network. for the pretrained squeezenet models, see (deep learning toolbox).

the syntax squeezenet('weights','none') is not supported for code generation.

yes

yes

yes

vgg-16

vgg-16 convolutional neural network. for the pretrained vgg-16 model, see (deep learning toolbox).

the syntax vgg16('weights','none') is not supported for code generation.

yes

yes

yes

vgg-19

vgg-19 convolutional neural network. for the pretrained vgg-19 model, see (deep learning toolbox).

the syntax vgg19('weights','none') is not supported for code generation.

yes

yes

yes

xception

xception convolutional neural network. for the pretrained xception model, see (deep learning toolbox).

the syntax xception('weights','none') is not supported for code generation.

yes

yes

yes

yolo v2

you only look once version 2 convolutional neural network based object detector. for more information, see (computer vision toolbox)

yes

yes

yes

supported layers

the following layers are supported for code generation by gpu coder for the target deep learning libraries specified in the table.

input layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(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.

yes

yes

yes

(deep learning toolbox)

a sequence input layer inputs sequence data to a network.

the cudnn library supports vector and 2-d image sequences. the tensorrt library support only vector input sequences.

for vector sequence inputs, the number of features must be a constant during code generation.

for image sequence inputs, the height, width, and the number of channels must be a constant during code generation.

code generation does not support 'normalization' specified using a function handle.

yes

yes

no

(deep learning toolbox)

a feature input layer inputs feature data to a network and applies data normalization.

yes

yes

yes

convolution and fully connected layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(deep learning toolbox)

a 2-d convolutional layer applies sliding convolutional filters to the input.

yes

yes

yes

fullyconnectedlayer (deep learning toolbox)

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

yes

yes

no

(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.

yes

yes

yes

(deep learning toolbox)

a transposed 2-d convolution layer upsamples feature maps.

yes

yes

yes

sequence layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(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'.

yes

yes

no

(deep learning toolbox)

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

yes

no

no

(deep learning toolbox)

a gru layer learns dependencies between time steps in time series and sequence data.

code generation supports only the 'after-multiplication' and 'recurrent-bias-after-multiplication' reset gate modes.

yes

yes

no

(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'.

yes

yes

no

(deep learning toolbox)

a sequence folding layer converts a batch of image sequences to a batch of images. use a sequence folding layer to perform convolution operations on time steps of image sequences independently.

yes

no

no

(deep learning toolbox)

a sequence input layer inputs sequence data to a network.

the cudnn library supports vector and 2-d image sequences. the tensorrt library support only vector input sequences.

for vector sequence inputs, the number of features must be a constant during code generation.

for image sequence inputs, the height, width, and the number of channels must be a constant during code generation.

code generation does not support 'normalization' specified using a function handle.

yes

yes

no

(deep learning toolbox)

a sequence unfolding layer restores the sequence structure of the input data after sequence folding.

yes

no

no

(text analytics toolbox)

a word embedding layer maps word indices to vectors.

yes

yes

no

activation layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(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.

yes

yes

yes

(deep learning toolbox)

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

yes

yes

no

(deep learning toolbox)

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

yes

yes

yes

(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.

yes

yes

yes

(reinforcement learning toolbox)

a softpluslayer is a deep neural network layer that implements the softplus activation y = log(1 ex), which ensures that the output is always positive.

yes

yes

no

(deep learning toolbox)

a swish activation layer applies the swish function on the layer inputs.

yes

yes

no

(deep learning toolbox)

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

yes

yes

yes

normalization, dropout, and cropping layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(deep learning toolbox)

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

yes

yes

yes

(deep learning toolbox)

a 2-d crop layer applies 2-d cropping to the input.

yes

yes

yes

(deep learning toolbox)

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

yes

yes

yes

(deep learning toolbox)

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

yes

yes

yes

(deep learning toolbox)

a group normalization layer normalizes a mini-batch of data across grouped subsets of channels for each observation independently.

yes

yes

no

(reinforcement learning toolbox)

scaling layer for actor or critic network.

for code generation, values for the 'scale' and 'bias' properties must have the same dimension.

yes

yes

yes

pooling and unpooling layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(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.

code generation using third-party libraries such as cudnn, arm compute does not support non-zero padding value.

for simulink® models that implement deep learning functionality using matlab function block, simulation errors out if the network contains an average pooling layer with non-zero padding value. in such cases, use the blocks from the deep neural networks library instead of a matlab function to implement the deep learning functionality.

yes

yes

yes

(deep learning toolbox)

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

yes

yes

yes

(deep learning toolbox)

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

yes

yes

yes

(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.

if equal max values exists along the off-diagonal in a kernel window, implementation differences for the maxpooling2dlayer might cause minor numerical mismatch between matlab® and the generated code. this issue also causes mismatch in the indices of the maximum value in each pooled region. for more information, see (deep learning toolbox).

yes

yes

yes

(deep learning toolbox)

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

if equal max values exists along the off-diagonal in a kernel window, implementation differences for the maxpooling2dlayer might cause minor numerical mismatch between matlab and the generated code. this issue also causes mismatch in the indices of the maximum value in each pooled region. for more information, see (deep learning toolbox).

yes

yes

no

combination layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(deep learning toolbox)

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

yes

yes

yes

(deep learning toolbox)

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

yes

yes

no

(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).

yes

yes

yes

object detection layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(computer vision toolbox)

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

yes

yes

yes

(image processing toolbox)

a 2-d depth to space layer permutes data from the depth dimension into blocks of 2-d spatial data.

yes

yes

yes

(computer vision toolbox)

a focal loss layer predicts object classes using focal loss.

yes

yes

yes

(image processing toolbox)

a space to depth layer permutes the spatial blocks of the input into the depth dimension. use this layer when you need to combine feature maps of different size without discarding any feature data.

yes

yes

yes

(computer vision toolbox)

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

yes

yes

no

(computer vision toolbox)

a box regression layer refines bounding box locations by using a smooth l1 loss function. use this layer to create a fast or faster r-cnn object detection network.

yes

yes

yes

(computer vision toolbox)

a region proposal network (rpn) classification layer classifies image regions as either object or background by using a cross entropy loss function. use this layer to create a faster r-cnn object detection network.

yes

yes

yes

(computer vision toolbox)

create output layer for yolo v2 object detection network.

yes

yes

yes

(computer vision toolbox)

create reorganization layer for yolo v2 object detection network.

yes

yes

yes

(computer vision toolbox)

create transform layer for yolo v2 object detection network.

yes

yes

yes

output layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

(deep learning toolbox)

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

yes

yes

yes

(computer vision toolbox)

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

yes

yes

yes

(computer vision toolbox)

a focal loss layer predicts object classes using focal loss.

yes

yes

yes

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 (deep learning toolbox).

for an example showing how to define a custom regression output layer and specify a loss function, see (deep learning toolbox).

yes

yes

yes

(computer vision toolbox)

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

yes

yes

yes

(computer vision toolbox)

a box regression layer refines bounding box locations by using a smooth l1 loss function. use this layer to create a fast or faster r-cnn object detection network.

yes

yes

yes

(deep learning toolbox)

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

yes

yes

yes

(computer vision toolbox)

a region proposal network (rpn) classification layer classifies image regions as either object or background by using a cross entropy loss function. use this layer to create a faster r-cnn object detection network.

yes

yes

yes

(deep learning toolbox)

a sigmoid layer applies a sigmoid function to the input.

yes

yes

yes

(deep learning toolbox)

a softmax layer applies a softmax function to the input.

yes

yes

yes

custom keras layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

nnet.keras.layer.cliplayer (deep learning toolbox)

clips the input between the upper and lower bounds.

yes

yes

no

nnet.keras.layer.flattencstylelayer (deep learning toolbox)

flatten activations into 1-d assuming c-style (row-major) order.

yes

yes

yes

nnet.keras.layer.globalaveragepooling2dlayer (deep learning toolbox)

global average pooling layer for spatial data.

yes

yes

yes

nnet.keras.layer.prelulayer (deep learning toolbox)

parametric rectified linear unit.

yes

yes

no

nnet.keras.layer.sigmoidlayer (deep learning toolbox)

sigmoid activation layer.

yes

yes

yes

nnet.keras.layer.tanhlayer (deep learning toolbox)

hyperbolic tangent activation layer.

yes

yes

yes

nnet.keras.layer.timedistributedflattencstylelayer (deep learning toolbox)

flatten a sequence of input image into a sequence of vector, assuming c-style (or row-major) storage ordering of the input layer.

yes

yes

no

nnet.keras.layer.zeropadding2dlayer (deep learning toolbox)

zero padding layer for 2-d input.

yes

yes

yes

custom onnx layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

nnet.onnx.layer.cliplayer (deep learning toolbox)

clips the input between the upper and lower bounds.

yes

yes

no

nnet.onnx.layer.elementwiseaffinelayer (deep learning toolbox)

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

yes

yes

yes

nnet.onnx.layer.flatteninto2dlayer (deep learning toolbox)

flattens a matlab 2d image batch in the way onnx does, producing a 2d output array with cb format.

yes

yes

no

nnet.onnx.layer.flattenlayer (deep learning toolbox)

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

yes

yes

yes

nnet.onnx.layer.globalaveragepooling2dlayer (deep learning toolbox)

global average pooling layer for spatial data.

yes

yes

yes

nnet.onnx.layer.identitylayer (deep learning toolbox)

layer that implements onnx identity operator.

yes

yes

yes

nnet.onnx.layer.prelulayer (deep learning toolbox)

parametric rectified linear unit.

yes

yes

no

nnet.onnx.layer.sigmoidlayer (deep learning toolbox)

sigmoid activation layer.

yes

yes

yes

nnet.onnx.layer.tanhlayer (deep learning toolbox)

hyperbolic tangent activation layer.

yes

yes

yes

nnet.onnx.layer.verifybatchsizelayer (deep learning toolbox)

verify fixed batch size.

yes

yes

yes

custom layers

layer namedescriptioncudnntensorrtarm compute library for mali gpu

custom layers

custom layers, with or without learnable parameters, that you define for your problem.

to learn how to define custom deep learning layers, see (deep learning toolbox) and (deep learning toolbox).

for an example on how to generate code for a network with custom layers, see code generation for object detection using yolo v3 deep learning network.

the outputs of the custom layer must be fixed-size arrays.

using 'unified' as the mallocmode in requires extra memory copies leading to slower performance. for custom layers, it is recommended to use 'discrete' mode. for more information on gpu memory allocation, see discrete and managed modes

cudnn targets support both row-major and column-major code generation for custom layers. tensorrt targets support only column-major code generation.

for code generation, custom layers must contain the %#codegen pragma.

code generation for a sequence network containing custom layer and lstm or gru layer is not supported.

you can pass dlarray to custom layers if:

  • the custom layer is in dlnetwork.

  • custom layer is in a dag or series network and either inherits from nnet.layer.formattable or has no backward propagation.

for unsupported dlarray methods, then you must extract the underlying data from the dlarray, perform the computations and reconstruct the data back into the dlarray for code generation. for example,

function z = predict(layer, x)
if coder.target('matlab')
   z = dopredict(x);
else
   if isdlarray(x)
      x1 = extractdata(x);
      z1 = dopredict(x1);
      z = dlarray(z1);
  else
      z = dopredict(x);
  end
end
end

yes

yes

no

supported classes

the following classes are supported for code generation by gpu coder for the target deep learning libraries specified in the table.

namedescriptioncudnntensorrtarm compute library for mali gpu
(deep learning toolbox)

directed acyclic graph (dag) network for deep learning

  • only the activations, predict, and classify methods are supported.

yes

yes

yes

(deep learning toolbox)

deep learning network for custom training loops

  • code generation supports only the inputnames and outputnames properties.

  • the initialized property of the dlnetwork object must be set to true.

  • you can generate code for dlnetwork that have vector and image sequence inputs. code generation support includes:

    • dlarray containing vector sequences that have 'ct' or 'cbt' data formats.

    • dlarray containing image sequences that have 'ssct' or 'sscbt' data formats.

    • multi-input dlnetwork with heterogeneous input layers. for rnn networks, multiple input is not supported.

    • dlarray inputs with a variable-size time (t) dimension. you use such dlarray objects to represent time series data of variable sequence length.

  • code generation supports only the predict object function. the dlarray input to the predict method must be a single datatype.

  • code generation supports dlnetwork for cudnn and tensorrt targets. code generation does not support dlnetwork for arm mali targets.

  • when targeting tensorrt with int8 precision, the last layer(s) of the network must be a softmaxlayer layer.

  • code generation supports mimo dlnetworks.

  • to create a dlnetwork object for code generation, see .

yes

yes

no

(lidar toolbox)

pointpillars network to detect objects in lidar point clouds

  • only the (lidar toolbox) method of the pointpillarsobjectdetector is supported for code generation.

  • only the threshold, selectstrongest, and minibatchsize name-value pairs of the detect method are supported.

yes

yes

no

(deep learning toolbox)

series network for deep learning

  • only the activations, classify, predict, predictandupdatestate, classifyandupdatestate, and resetstate object functions are supported.

yes

yes

yes

(computer vision toolbox)

detect objects using the ssd-based detector.

  • only the (computer vision toolbox) 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.

yes

yes

no

(computer vision toolbox)

detect objects using yolo v2 object detector

  • only the (computer vision toolbox) 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.

yes

yes

yes

(computer vision toolbox)

detect objects using yolo v3 object detector

  • only the (computer vision toolbox) method of the yolov3objectdetector 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.

yes

yes

no

(computer vision toolbox)

detect objects using yolo v4 object detector

  • only the (computer vision toolbox) method of the yolov3objectdetector is supported for code generation.

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

  • only the threshold, selectstrongest, minsize, maxsize, and minibatchsize name-value pairs for detect are supported.

yes

yes

no

see also

functions

objects

  • | | | | |

related topics

网站地图