It is possible to implement a LSTM neural network built with Keras Python in a Simulink block?

조회 수: 5 (최근 30일)
Hello!
I have a LSTM neural network (for time series prediction) built in Python with Keras. So I have the model (structure and weights) in .h5 file.
It is possible to implement a LSTM neural network built with Keras Python in a Simulink block?
I would to create a simulink file that takes in input 2 signals and passing through the NN block , gives me as output the predicted signal.
  댓글 수: 2
Szabolcs Mike
Szabolcs Mike 2019년 5월 6일
Same question here too! I would like to use a LSTM prediction model trained with keras in Simulink. I can import the model to Matlab workspace, but not able to use it in a Matlab function block in Simulink!

댓글을 달려면 로그인하십시오.

답변 (2개)

Oskar Karnblad
Oskar Karnblad 2018년 1월 11일
I'm also interested in this. Have you found a solution yet?

Arkadiy Turevskiy
Arkadiy Turevskiy 2021년 10월 18일
You can do it in two steps:
  1. Import a model into MATLAB. See this function for TensrFlow 2 or this function to import from Keras.
  2. Once you have imported the model, use Stateful Predict block. This block became available in 21a.
HTH.
Arkadiy

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by