自己在python编​写的基于pytorc​h的深度强化学习算法​能否导入matlab​/simulink

18 次查看(过去 30 天)
yfxcore
yfxcore 2024-1-31
回答: Krishna 2024-2-11
通过查看importNetworkFromPyTorch文档,里面的模型都是预定义好的自由度较小,那么我自己编写的基于pytorch的深度强化学习算法能否导入进来呢?

回答(1 个)

Krishna
Krishna 2024-2-11
Hello yfxcore,
You can indeed import Pytorch and TensorFlow models into MATLAB/Simulink. To do so for Pytorch, you can use the function called 'importNetworkFromPyTorch'. For additional information, consult the following documentation:
The function importNetworkFromPyTorch(model file) allows you to import a pretrained and traced Pytorch model from the specified model file. This function returns the network as an uninitialized ‘dlnetwork’ object. To use importNetworkFromPyTorch, you need the Deep Learning Toolbox Converter for Pytorch Models support package.
This dlnetworks object can be converted into a Simulink model using predict block. For more information on predict block follow the following documentation,
Also please refer to the following guidelines to ask questions on MATLAB answer and get better response,
Hope this helps.

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

产品


版本

R2023b

Community Treasure Hunt

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

Start Hunting!