Main Content

Deep Learning Code Generation Fundamentals

Functions, objects, and workflows that you can use to generate code for deep learning networks

You can use GPU Coder™ in tandem with the Deep Learning Toolbox™ to generate code and deploy CNN on multiple embedded platforms that use NVIDIA® or ARM® GPU processors. The Deep Learning Toolbox provides simple MATLAB® commands for creating and interconnecting the layers of a deep neural network. The availability of pretrained networks and examples such as image recognition and driver assistance applications enable you to use GPU Coder for deep learning, without expert knowledge on neural networks, deep learning, or advanced computer vision algorithms.

Apps

expand all

GPU CoderGenerate GPU code from MATLAB code
GPU Environment CheckVerify and set up GPU code generation environment

Functions

expand all

codegenGenerate C/C++ code from MATLAB code
cnncodegenGenerate code for a deep learning network to target the ARM Mali GPU
coder.loadDeepLearningNetworkLoad deep learning network model
coder.DeepLearningConfigCreate deep learning code generation configuration objects
analyzeNetworkForCodegenAnalyze deep learning network for code generation (Since R2022b)
coder.regenerateDeepLearningParametersRegenerate files containing network learnables and states parameters (Since R2021b)

Objects

expand all

coder.CuDNNConfigParameters to configure deep learning code generation with the CUDA Deep Neural Network library
coder.TensorRTConfigParameters to configure deep learning code generation with the NVIDIA TensorRT library
coder.gpuConfigConfiguration parameters for CUDA code generation from MATLAB code by using GPU Coder
coder.gpuEnvConfigConfiguration object containing the parameters to check the GPU code generation environment

Basics

Code Generation Overview

Overview of CUDA® code generation workflow for convolutional neural networks.

Load Pretrained Networks for Code Generation

Create a SeriesNetwork, DAGNetwork, yolov2ObjectDetector, ssdObjectDetector, or dlnetwork object for code generation.

Supported Networks, Layers, and Classes

Networks, layers, and classes supported for code generation.

Analyze Network for Code Generation

Check code generation compatibility of a deep learning network.

Code Generation for dlarray

Use deep learning arrays in MATLAB code intended for code generation.

dlarray Limitations for Code Generation

Adhere to code generation limitations for deep learning arrays.

Analyze Performance of Code Generated for Deep Learning Networks

Analyze and optimize the performance of the generated CUDA code for deep learning networks.

Topics

Featured Examples