Integrate TensorFlow Model into Simulink for Simulation and Code Generation

preview_player
Показать описание
Watch a quick demonstration of how to use a pretrained TensorFlow™ network in Simulink® to implement a deep learning-based, state-of-charge estimation algorithm for a battery management system.

This demo uses a neural network that has been trained in TensorFlow using battery discharge data measured in the lab.

The example has two parts: importing a pretrained TensorFlow model into MATLAB® and using the imported model in Simulink for simulation and library-free C code generation. The first part shows how to use the importTensorFlowNetwork command to bring a neural network into MATLAB from TensorFlow and how to visualize an imported network in Deep Network Designer.

The second part illustrates how to put an imported network into a Simulink model using Predict block. Using this block, the network is simulated and results are compared with the true state-of-charge level as well as an estimate obtained using an extended Kalman Filter. Finally, the imported network is used to generate library-free C code that can run on any microcontroller or ECU, including the NXP S32K boards.

--------------------------------------------------------------------------------------------------------

© 2022 The MathWorks, Inc. MATLAB and Simulink are registered trademarks of The MathWorks, Inc.
Рекомендации по теме
Комментарии
Автор

I have two questions which might motivate for more videos:

1. Is there also a way to import other models such as Decision Trees etc.?
2. What is the best way to import c-files in a simulink model? To be more precise I think of using c-code in a simulink model for implementation on a SpeedGoat system (RCP).

ChristianSch-il
Автор

Hello,

I have the deep learning toolbox installed as well as the Deep Learning Toolbox importer for tensorflow-keras models, but I keep getting an error every time I try to use the importTensorFlowNetwork command. The importKerasNetwork command works however, but I need my model saved in DAGNetwork format.

>> test =
Unrecognized function or variable 'importTensorFlowNetwork'.

mikejadwin
visit shbcf.ru