Simulink を使用した深層学習
Deep Learning Toolbox™ に含まれる Deep Neural Networks、Python Neural Networks、および Deep Learning Layers の各ブロック ライブラリのブロックを使用するか、Computer Vision Toolbox™ に含まれる Analysis & Enhancement ブロック ライブラリの Deep Learning Object Detector ブロックを使用して、Simulink® モデルの深層学習機能を実装します。
Deep Learning Layers ブロック ライブラリを使用してネットワークを表す Simulink モデルを生成するには、exportNetworkToSimulink
関数を使用します。
Simulink の一部の深層学習機能では、サポートされているコンパイラを必要とする MATLAB Function ブロックを使用しています。ほとんどのプラットフォームでは、既定の C コンパイラが MATLAB® インストールで提供されます。C++ 言語を使用する場合は、互換性のある C++ コンパイラをインストールしなければなりません。サポートされているコンパイラのリストを確認するには、Supported and Compatible Compilers を開き、オペレーティング システムに対応するタブをクリックして、Simulink Product Family テーブルを見つけ、For Model Referencing, Accelerator mode, Rapid Accelerator mode, and MATLAB Function blocks 列に移動します。システムに複数の MATLAB 対応コンパイラがインストールされている場合は、mex -setup
コマンドを使用して既定のコンパイラを変更できます。既定のコンパイラの変更を参照してください。
関数
exportNetworkToSimulink | Generate Simulink model that contains deep learning layer blocks and subsystems that correspond to deep learning layer objects (R2024b 以降) |
ブロック
トピック
深層学習層ブロック
- List of Deep Learning Layer Blocks and Subsystems
Discover all the deep learning layer blocks and subsystems in Simulink. - Implement Unsupported Deep Learning Layer Blocks
This example shows how to implement layers using Simulink blocks or MATLAB code in a MATLAB Function block.
イメージ
- GoogLeNet を使用した Simulink でのイメージの分類
この例では、Image Classifier
ブロックを使用して、Simulink® でイメージを分類する方法を説明します。 - Acceleration for Simulink Deep Learning Models
Improve simulation speed with accelerator and rapid accelerator modes. - 深層学習を使用した Simulink での車線検出と車両検出
この例では、Simulink® モデル内で深層畳み込みニューラル ネットワークを使用して、車線検出と車両検出を実行する方法を示します。 - 深層学習を使用した Simulink での ECG 信号の分類
この例では、Simulink (R) モデル内でウェーブレット変換と深層学習ネットワークを使用して ECG 信号を分類する方法を示します。 - Classify Images in Simulink with Imported TensorFlow Network
Import a pretrained TensorFlow™ network usingimportTensorFlowNetwork
, and then use the Predict block for image classification in Simulink.
シーケンス
- Simulink でのネットワークの状態の予測と更新
この例では、Stateful Predict
ブロックを使用して、学習済みの再帰型ニューラル ネットワークの応答を Simulink® で予測する方法を説明します。 - Simulink でのネットワークの状態の分類と更新
この例では、Stateful Classify
ブロックを使用して、Simulink® で学習済みの再帰型ニューラル ネットワークのデータを分類する方法を説明します。 - Speech Command Recognition in Simulink
Detect the presence of speech commands in audio using a Simulink model. - 深層学習ネットワークを使用した Simulink での時系列の予測
この例では、Simulink® モデル内で LSTM 深層学習ネットワークを使用し、エンジンの残存耐用年数 (RUL) を予測する方法を示します。 - Simulate Calorie Burn Using Neural Network in Simulink
This example shows how to include a simple fully connected neural network in a Simulink® model that predicts calorie burn when given five time steps of sensor readings from a smart watch. - 深層学習を使用したバッテリー充電状態の推定
要件の定義、データの準備、深層学習ネットワークの学習、ロバスト性の検証、Simulink へのネットワークの統合、モデルの展開を行う。 (R2024b 以降) - Simulink における LSTM ネットワークを使用した物理システムのモデリング
この例では、長短期記憶 (LSTM) ニューラル ネットワークを使用して、Simulink® モデルでバーチャル センサーとして機能する低次元化モデル (ROM) を作成する方法を示します。 - Classify Motor Faults Using Deep Learning
This example shows how to train a deep learning model to classify faults in a permanent magnet synchronous motor (PMSM) using simulated data across various revolutions per minute (RPM). You use Simscape Electrical™ to create the model for a fault scenario, then use Deep Learning Toolbox™ to train a neural network to classify the fault data. (R2025a 以降) - Improve Performance of Deep Learning Simulations in Simulink
This example shows how to use code generation to improve the performance of deep learning simulations in Simulink®.
強化学習
- DDPG エージェントを使用したタンク内の水位の制御 (Reinforcement Learning Toolbox)
Simulink で学習環境としてモデル化されたプラントを使用し、強化学習を使ってコントローラーに学習させる。 - アダプティブ クルーズ コントロール用の DDPG エージェントの学習 (Reinforcement Learning Toolbox)
アダプティブ クルーズ コントロール アプリケーション用の DDPG エージェントに学習させる。 - 並列計算を使用した車線維持支援用 DQN エージェントの学習 (Reinforcement Learning Toolbox)
並列計算を使用して自動運転アプリケーションのために DQN エージェントに学習させる。 - 経路追従制御用の DDPG エージェントの学習 (Reinforcement Learning Toolbox)
車線追従制御用に DDPG エージェントに学習させる。
Python の共同実行
- Classify Images Using TensorFlow Model Predict Block
Classify images using TensorFlow Model Predict block. - Classify Images Using ONNX Model Predict Block
Classify images using ONNX Model Predict block. - Classify Images Using PyTorch Model Predict Block
Classify images using PyTorch Model Predict block. - Predict Responses Using TensorFlow Model Predict Block
Predict Responses Using TensorFlow Model Predict block. - Predict Responses Using ONNX Model Predict Block
Predict Responses Using ONNX Model Predict block. - Predict Responses Using PyTorch Model Predict Block
Predict Responses Using PyTorch Model Predict block. - Simulink でのカスタム Python モデルを使用した応答の予測 (Statistics and Machine Learning Toolbox)
この例では、Custom Python Model Predict (Statistics and Machine Learning Toolbox)ブロックを Simulink® での予測に使用する方法を示します。
コード生成
- Simulink アプリケーションからの深層学習コードの生成
デスクトップまたは組み込みターゲットに展開するための C/C++ コードおよび GPU コードの生成 - Export Network to FMU
This example shows how to export a trained network as a Functional Mock-up Unit (FMU). (R2023b 以降)