Main Content

coder.getDeepLearningLayers

Get the list of layers supported for code generation for a specific deep learning library

coder.getDeepLearningLayers is not recommended. Use analyzeNetworkForCodegen instead. For more information, see Version History.

Description

coder.getDeepLearningLayers returns the layers supported for code generation that do not use any third-party libraries.

coder.getDeepLearningLayers(TargetLibrary = libraryname) returns the layers supported for code generation for a specific deep learning library.

Note

To use coder.getDeepLearningLayers, you must install the support package that corresponds to libraryname:

  • For 'none', 'arm-compute', 'cmsis-nn', and 'mkldnn', install MATLAB® Coder™ Interface for Deep Learning.

  • For 'cudnn', 'tensorrt', or 'arm-compute-mali', install GPU Coder™ Interface for Deep Learning.

Note

The coder.getDeepLearningLayers function does not list certain custom layers if the associated support packages are not installed. For example, keras layers are not listed if the Deep Learning Toolbox™ Converter for TensorFlow™ Models support package is not installed.

example

Examples

collapse all

Get a list of layers supported for code generation for Intel® Math Kernel Library for Deep Neural Networks.

coder.getDeepLearningLayers(TargetLibrary = 'mkldnn')
ans =

  59×1 cell array

    {'AdditionLayer'                               }
    {'AnchorBoxLayer'                              }
    {'AveragePooling2DLayer'                       }
    {'BatchNormalizationLayer'                     }
    {'BiLSTMLayer'                                 }
    {'ClassificationOutputLayer'                   }
    {'ClippedReLULayer'                            }
    {'ConcatenationLayer'                          }
    {'Convolution2DLayer'                          }
    {'Crop2DLayer'                                 }
    {'CrossChannelNormalizationLayer'              }
    {'DepthConcatenationLayer'                     }
    {'DepthToSpace2DLayer'                         }
    {'DicePixelClassificationLayer'                }
    {'DropoutLayer'                                }
    {'ELULayer'                                    }
    {'FeatureInputLayer'                           }
    {'FlattenLayer'                                }
    {'FocalLossLayer'                              }
    {'FullyConnectedLayer'                         }
    {'GRULayer'                                    }
    {'GlobalAveragePooling2DLayer'                 }
    {'GlobalMaxPooling2DLayer'                     }
    {'GroupedConvolution2DLayer'                   }
    {'ImageInputLayer'                             }
    {'LSTMLayer'                                   }
    {'LeakyReLULayer'                              }
    {'MaxPooling2DLayer'                           }
    {'MaxUnpooling2DLayer'                         }
    {'MultiplicationLayer'                         }
    {'PixelClassificationLayer'                    }
    {'RCNNBoxRegressionLayer'                      }
    {'RPNClassificationLayer'                      }
    {'ReLULayer'                                   }
    {'RegressionOutputLayer'                       }
    {'Resize2DLayer'                               }
    {'SSDMergeLayer'                               }
    {'SequenceFoldingLayer'                        }
    {'SequenceInputLayer'                          }
    {'SequenceUnfoldingLayer'                      }
    {'SigmoidLayer'                                }
    {'SoftmaxLayer'                                }
    {'SpaceToDepthLayer'                           }
    {'TanhLayer'                                   }
    {'TransposedConvolution2DLayer'                }
    {'WordEmbeddingLayer'                          }
    {'YOLOv2OutputLayer'                           }
    {'YOLOv2ReorgLayer'                            }
    {'YOLOv2TransformLayer'                        }
    {'nnet.keras.layer.FlattenCStyleLayer'         }
    {'nnet.keras.layer.GlobalAveragePooling2dLayer'}
    {'nnet.keras.layer.SigmoidLayer'               }
    {'nnet.keras.layer.TanhLayer'                  }
    {'nnet.keras.layer.ZeroPadding2dLayer'         }
    {'nnet.onnx.layer.ElementwiseAffineLayer'      }
    {'nnet.onnx.layer.FlattenLayer'                }
    {'nnet.onnx.layer.IdentityLayer'               }
    {'ScalingLayer'                                }
    {'SoftplusLayer'                               }

Input Arguments

collapse all

Name of deep learning library, specified as one of the values in this table.

ValueDescription
'arm-compute'

ARM® Compute Library for targeting ARM CPU processors.

Requires the MATLAB Coder Interface for Deep Learning.

'arm-compute-mali'

ARM Compute Library for targeting ARM GPU processors.

Requires the GPU Coder product and the GPU Coder Interface for Deep Learning.

'cmsis-nn'

Common Microcontroller Software Interface Standard - Neural Network (CMSIS-NN) library.

Requires the MATLAB Coder Interface for Deep Learning.

'cudnn'

NVIDIA® CUDA® Deep Neural Network library (cuDNN).

Requires the GPU Coder product and the GPU Coder Interface for Deep Learning.

'mkldnn'

Intel Math Kernel Library for Deep Neural Networks.

Requires the MATLAB Coder Interface for Deep Learning.

'none'

coder.getDeepLearningLayers(TargetLibrary = 'none') returns the layers supported for code generation that do not use any third-party libraries. This is equivalent to calling coder.getDeepLearningLayers with no input argument.

Requires the MATLAB Coder Interface for Deep Learning.

'tensorrt'

NVIDIA TensorRT™ high performance deep learning inference optimizer and run-time library.

Requires the GPU Coder product and the GPU Coder Interface for Deep Learning.

Version History

Introduced in R2018b

collapse all

R2022b: coder.getDeepLearningLayers is not recommended

coder.getDeepLearningLayers is not recommended. Use analyzeNetworkForCodegen instead.

Starting in R2022b, check the code generation compatibility of a deep learning network by using the analyzeNetworkForCodegen function.