How to generate code from a trained LSTM network using MATLAB/Simulink?
조회 수: 12 (최근 30일)
이전 댓글 표시
MathWorks Support Team
2020년 9월 9일
편집: MathWorks Support Team
2023년 11월 17일
Is code generation from a trained LSTM network supported, and if so, how? There appear to be different approaches to generate code from a trained LSTM network while working without/with Simulink.
채택된 답변
MathWorks Support Team
2023년 11월 17일
편집: MathWorks Support Team
2023년 11월 17일
In order to generate code from a trained LSTM network using MATLAB, there are different approaches:
(a) Generate C/C++ code using MATLAB Coder:
From MATLAB R2020a onwards, you can generate code for ARM Cortex-A CPUs. Refer to the blog post below on how to get started with deep learning models on ARM Cortex-A with MATLAB:
Another example is here: https://www.mathworks.com/help/coder/ug/code-generation-for-lstm-network-on-raspberry-pi.html
From MATLAB R2020b onwards, you can generate C++ code for an LSTM network, a stateful LSTM network, or a bidirectional LSTM network that uses the Intel® MKL-DNN library.
(b) Generate CUDA code using GPU Coder:
From R2019b onwards, you can generate code for NVIDIA GPUs. See the following documentation link for more information:
From R2020b onwards, using MATLAB Coder or GPU Coder, you can use coder.loadDeepLearningNetwork and other associated functions to run inference in a MATLAB Function block. This will support accelerated simulation and code generation for both CPU or GPU targets. The following link illustrates the workflow:
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!