How to create VHDL code of a Neural Network block created through GENSIM command ?

5 views (last 30 days)
-

Answers (1)

Kiran Kintali
Kiran Kintali on 16 Jul 2023
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.

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!