从 MATLAB 应用程序生成 GPU 代码
生成用于在桌面或嵌入式目标上部署的 CUDA® 代码
将 GPU Coder™ 与 Deep Learning Toolbox™ 结合使用,生成在桌面或嵌入式目标上运行的 CUDA MEX 或独立 CUDA 代码。您可以部署生成的独立 CUDA 代码,该代码使用 CUDA 深度神经网络库 (cuDNN)、TensorRT™ 高性能推理库或 Mali GPU 的 ARM® Compute 库。
函数
codegen | 从 MATLAB 代码生成 C/C++ 代码。 |
coder.getDeepLearningLayers | Get the list of layers supported for code generation for a specific deep learning library |
coder.loadDeepLearningNetwork | Load deep learning network model |
coder.DeepLearningConfig | Create deep learning code generation configuration objects |
App
GPU Coder | Generate GPU code from MATLAB code |
主题
概述
- Supported Networks, Layers, and Classes (GPU Coder)
Networks, layers, and classes supported for code generation. - Code Generation for dlarray (GPU Coder)
Use deep learning arrays in MATLAB code intended for code generation. - Code Generation for Deep Learning Networks by Using cuDNN (GPU Coder)
Generate code for pretrained convolutional neural networks by using the cuDNN library. - Code Generation for Deep Learning Networks by Using TensorRT (GPU Coder)
Generate code for pretrained convolutional neural networks by using the TensorRT library. - Update Network Parameters After Code Generation (GPU Coder)
Perform post code generation updates of deep learning network parameters.
应用
- Code Generation for a Deep Learning Simulink Model That Performs Lane and Vehicle Detection (GPU Coder)
This example shows how to develop a CUDA® application from a Simulink® model that performs lane and vehicle detection using convolutional neural networks (CNN). - Generate Digit Images on NVIDIA GPU Using Variational Autoencoder (GPU Coder)
CUDA code generation fordlnetwork
anddlarray
objects. - Code Generation for Object Detection Using YOLO v3 Deep Learning Network
This example shows how to generate CUDA® MEX for a you only look once (YOLO) v3 object detector. - Code Generation for a Deep Learning Simulink Model to Classify ECG Signals (GPU Coder)
This example demonstrates how you can use powerful signal processing techniques and Convolutional Neural Networks together to classify ECG signals. - 深度学习网络的代码生成
此示例说明如何为使用深度学习的图像分类应用程序执行代码生成。它使用codegen
命令生成一个 MEX 函数,该函数使用图像分类网络(如 MobileNet-v2、ResNet 和 GoogLeNet)运行预测。 - Code Generation for a Sequence-to-Sequence LSTM Network
This example demonstrates how to generate CUDA® code for a long short-term memory (LSTM) network. - Deep Learning Prediction on ARM Mali GPU
This example shows how to use thecnncodegen
function to generate code for an image classification application that uses deep learning on ARM® Mali GPUs. - Deploy Signal Classifier on NVIDIA Jetson Using Wavelet Analysis and Deep Learning
Generate and deploy a CUDA executable to classify electrocardiogram signals using wavelet-derived features. - 为使用 YOLO v2 的目标检测生成代码
此示例说明如何为 you only look once (YOLO) v2 目标检测器生成 CUDA® MEX。YOLO v2 目标检测网络由两个子网络组成。一个特征提取网络,后跟一个检测网络。此示例为 Computer Vision Toolbox™ 的使用 YOLO v2 深度学习进行目标检测示例中训练的网络生成代码。有关详细信息,请参阅Object Detection Using YOLO v2 Deep Learning (Computer Vision Toolbox)。您可以修改此示例,以便为从 Computer Vision Toolbox™ 中的导入预训练 ONNX YOLO v2 目标检测器示例导入的网络生成 CUDA® MEX。有关详细信息,请参阅Import Pretrained ONNX YOLO v2 Object Detector (Computer Vision Toolbox)。 - 使用 GPU Coder 优化车道检测
此示例说明如何开发在 NVIDIA® GPU 上运行的深度学习车道检测应用。 - Deep Learning Prediction with NVIDIA TensorRT Library
This example shows how to generate code for a deep learning application by using the NVIDIA® TensorRT™ library. - 交通标志检测和识别
此示例说明如何为使用深度学习的交通标志检测和识别应用程序生成 CUDA® MEX 代码。交通标志检测和识别是驾驶辅助系统的重要应用,可辅助并向驾驶员提供有关道路标志的信息。 - 徽标识别网络
此示例说明如何为使用深度学习的徽标分类应用程序生成代码。它使用名为 LogoNet 的预训练网络,并将一个输入图像分类为 32 个徽标类别。此示例还说明如何使用经过预处理的训练数据集来训练网络。最后,此示例使用codegen
命令生成 MEX 函数并执行预测。 - 去噪深度神经网络的代码生成
此示例说明如何从 MATLAB® 代码生成 CUDA® MEX,以及如何使用去噪卷积神经网络 (DnCNN [1]) 对灰度图像进行去噪。您可以使用去噪网络估计含噪图像中的噪声,然后将其去除以获得去噪图像。 - 语义分割网络的代码生成
此示例说明如何为使用深度学习的图像分割应用程序生成代码。它使用codegen
命令生成一个基于 SegNet [1] 的 DAG 网络对象执行预测的 MEX 函数。SegNet 是一种用于图像分割的深度学习网络。 - 训练和部署用于语义分割的全卷积网络
此示例说明如何使用 GPU Coder™ 在 NVIDIA® GPU 上训练和部署全卷积语义分割网络。 - 使用 U-Net 的语义分割网络的代码生成
此示例说明如何为使用深度学习的图像分割应用程序生成代码。它使用codegen
命令生成一个基于 U-Net 的 DAG 网络对象执行预测的 MEX 函数。U-Net 是一种用于图像分割的深度学习网络。 - Code Generation for Object Detection Using YOLO v4 Deep Learning
Generate standalone CUDA® executable for a you only look once (YOLO) v4 object detector with custom layers. The tiny YOLO v4 network is a lightweight version of the YOLO v4 network with fewer network layers. It uses a feature pyramid network as the neck and has two YOLO v4 detection heads. The network was trained on COCO dataset. For more information about YOLO v4 object detection network, see Getting Started with YOLO v4 and Detect objects using YOLO v4 object detector.