Main Content

Deep Learning with GPU Coder

Generate CUDA® code for deep learning neural networks

Deep learning is a branch of machine learning that teaches computers to do what comes naturally to humans: learn from experience. The learning algorithms use computational methods to “learn” information directly from data without relying on a predetermined equation as a model. Deep learning uses convolutional neural networks (CNNs) to learn useful representations of data directly from images. Neural networks combine multiple nonlinear processing layers, using simple elements operating in parallel and inspired by biological nervous systems. Deep learning models are trained by using a large set of labeled data and neural network architectures that contain many layers, usually including some convolutional layers.

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 (Since R2019a)

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.gpuEnvConfigCreate configuration object containing the parameters passed to coder.checkGpuInstall for performing GPU code generation environment checks (Since R2019a)

Basics

Deep Learning in MATLAB (Deep Learning Toolbox)

Discover deep learning capabilities in MATLAB using convolutional neural networks for classification and regression, including pretrained networks and transfer learning, and training on GPUs, CPUs, clusters, and clouds.

Learn About Convolutional Neural Networks (Deep Learning Toolbox)

An introduction to convolutional neural networks and how they work in MATLAB.

Pretrained Deep Neural Networks (Deep Learning Toolbox)

Learn how to download and use pretrained convolutional neural networks for classification, transfer learning and feature extraction.

Training

Image Data Workflows (Deep Learning Toolbox)

Use pretrained networks or create and train networks from scratch for image classification and regression

Code Generation Overview

Workflow

Overview of CUDA code generation workflow for convolutional neural networks.

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.

Generated CNN Class Hierarchy

Architecture of the generated CNN class and its methods.

Topics

MATLAB

Simulink

Related Information