从 MATLAB 应用生成 CPU 代码
生成用于在桌面或嵌入式目标上部署的 C/C++ 代码
将 MATLAB® Coder™、Simulink® Coder 和 Embedded Coder® 的组合与 Deep Learning Toolbox™ 结合使用,以生成在桌面或嵌入式目标上运行的 MEX 或独立 CPU 代码。您可以部署生成的使用 Intel® MKL-DNN 库或 ARM® Compute 库的独立代码。您也可以生成不调用第三方库函数的泛型 CPU 代码。您还可以生成和部署使用 TensorFlow™ Lite 模型来执行推断的代码。
函数
codegen | 从 MATLAB 代码生成 C/C++ 代码。 |
coder.getDeepLearningLayers | Get the list of layers supported for code generation for a specific deep learning library |
coder.loadDeepLearningNetwork | 加载深度学习网络模型 |
coder.loadNetworkDistributionDiscriminator | Load network distribution discriminator for code generation (自 R2023a 起) |
coder.DeepLearningConfig | Create deep learning code generation configuration objects |
loadTFLiteModel | Load TensorFlow Lite model (自 R2022a 起) |
predict | Compute deep learning network output for inference by using a TensorFlow Lite model (自 R2022a 起) |
TFLiteModel | TensorFlow Lite model (自 R2022a 起) |
App
MATLAB Coder | 从 MATLAB 代码生成 C 代码或 MEX 函数 |
主题
概述
- 代码生成支持的网络和层 (MATLAB Coder)
选择目标处理器支持的卷积神经网络。 - 加载预训练网络以用于代码生成 (MATLAB Coder)
创建SeriesNetwork
、DAGNetwork
、yolov2ObjectDetector
、ssdObjectDetector
或dlnetwork
对象以用于代码生成。 - Code Generation for dlarray (MATLAB Coder)
Use deep learning arrays in MATLAB code intended for code generation. - Generate Digit Images Using Variational Autoencoder on Intel CPUs (MATLAB Coder)
Generate code for a trained VAE dlnetwork to generate hand-drawn digits. - Prerequisites for Deep Learning with TensorFlow Lite Models
Install products and configure environment for simulation and code generation with TensorFlow Lite models.
应用
- 生成代码并将 SqueezeNet 网络部署到 Raspberry Pi
此示例说明如何为预训练的 SqueezeNet 网络生成不依赖于任何第三方深度学习库的 C 代码。此示例使用处理器在环 (PIL) 工作流生成 MEX 函数,该函数又从 MATLAB® 调用在 Raspberry Pi™ 硬件中生成的可执行文件。 - 通过 ARM 计算使用 codegen 进行深度学习预测
此示例说明如何使用codegen
为在 ARM® 处理器上使用深度学习的徽标分类应用程序生成代码。徽标分类应用程序使用dlnetwork
对象从图像中执行徽标识别。生成的代码利用 ARM Compute Library 进行计算机视觉和机器学习。 - Generate Code for a Deep Learning Network for x86-64 Platforms Using Advanced Vector Instructions
This example shows how to generate code that uses advanced vector instructions and implements an image classification algorithm. - Generate C++ Code for Object Detection Using YOLO v2 and Intel MKL-DNN
This example shows how to generate C++ code for the YOLO v2 Object detection network on an Intel® processor. - Deploy Signal Classifier Using Wavelets and Deep Learning on Raspberry Pi
Classify human electrocardiogram signals on a Raspberry Pi® using scalograms and a deep convolutional neural network. - Deploy Signal Segmentation Deep Network on Raspberry Pi
Generate a MEX function and a standalone executable to perform waveform segmentation on a Raspberry Pi. - Generate Code and Deploy MobileNet-v2 Network to Raspberry Pi
This example shows how to generate C code that does not depend on any third-party deep learning libraries for pretrained MobileNet-v2 network. - Code Generation for Semantic Segmentation Application on ARM Neon Targets That Uses U-Net
Generate a static library that performs image segmentation by using the deep learning network U-Net on ARM targets. - Code Generation for LSTM Network on Raspberry Pi
Generate code for a pretrained long short-term memory network to predict Remaining Useful Life (RUI) of a machine. - Code Generation for LSTM Network That Classifies Text Data
Generate code for a pretrained LSTM network that makes predictions for each step of an input timeseries. - Cross Compile Deep Learning Code for ARM Neon Targets
Generate library or executable code on host computer for deployment on ARM hardware target. - Generate INT8 Code for Deep Learning Network on Raspberry Pi (MATLAB Coder)
Generate code for deep learning network that performs inference computations in 8-bit integers. - Generate Generic C Code for Sequence-to-Sequence Regression Using Deep Learning
Generate C/C++ code for a trained CNN that does not depend on any third-party libraries. - Generate Code for LSTM Network and Deploy on Cortex-M Target (MATLAB Coder)
Generate a Processor-In-the-Loop (PIL) executable that runs on an STM32F746G-Discovery board. - Generate Code for TensorFlow Lite (TFLite) Model and Deploy on Raspberry Pi
Generate code that uses a TensorFlow Lite model for inference. - Deploy Classification Application Using Mobilenet-V3 TensorFlow Lite Model on Host and Raspberry Pi
Generate code for a classification segmentation application that uses Tensorflow Lite model. - Deploy Semantic Segmentation Application Using TensorFlow Lite Model on Host and Raspberry Pi
Generate code for an image segmentation application that uses Tensorflow Lite model. - Deploy Super Resolution Application That Uses TensorFlow Lite (TFLite) Model on Host and Raspberry Pi
Generate code for a super resolution application that uses a TFLite model for inference. - Deploy Pose Estimation Application Using TensorFlow Lite Model (TFLite) Model on Host and Raspberry Pi
Simulate and generate code for a TensorFlow Lite model for 2D human pose estimation.