How to create VHDL code of a Neural Network block created through GENSIM command ?
6 次查看(过去 30 天)
显示 更早的评论
回答(1 个)
Kiran Kintali
2023-7-16
This example shows how to convert a neural network regression model (created using gensim) to HDL Code.
% The engine_dataset contains data representing the relationship between the fuel rate and speed of the engine, and its torque and gas emissions. Use the Neural Net Fitting app (nftool) from Deep Learning Toolbox™ to train a neural network to estimate torque and gas emissions of an engine given the fuel rate and speed.
load engine_dataset;
% Use the following commands to train the neural network.
x = engineInputs;
t = engineTargets;
net = fitnet(10);
net = train(net,x,t);
view(net)
%close all GUI after inspection
nnet.guis.closeAllViews();
% Once the network is trained, use the gensim function from the Deep Learning Toolbox to generate a Simulink model.
[sysName, netName] = gensim(net, 'Name', 'mTrainedNN');
Follow the steps in the example to do fixed-point conversion prior to HDL code generation.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!