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

18 visualizaciones (últimos 30 días)
yfxcore
yfxcore el 31 de En. de 2024
Respondida: Krishna el 11 de Feb. de 2024
通过查看importNetworkFromPyTorch文档,里面的模型都是预定义好的自由度较小,那么我自己编写的基于pytorch的深度强化学习算法能否导入进来呢?

Respuestas (1)

Krishna
Krishna el 11 de Feb. de 2024
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.

Categorías

Más información sobre Deep Learning Toolbox en Help Center y File Exchange.

Productos


Versión

R2023b

Community Treasure Hunt

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

Start Hunting!