how to predict from a trained neural network ?

Technical Source
2 min readJun 30, 2021

--

Hello I am trying to use neural network to make some prediction based on my input and target data. I have read all related tutorial in Matlab and also looked at the matlab examples. I kinda learned how to develop a network but I dont know how to use this train network to make some prediction ? is there any code that im missing ? does anyone have a sample script that can be shared here?

that’s what I have, for example : x=[1 2 3;4 5 3] t=[0.5 0.6 0.7] , net=feedforwardnet(10) , net=train(net,x,t) , perf=perform(net,y,t)

how can I predict the output for a new set of x (xprime=[4 2 3;4 7 8]) based on this trained network? thanks

ANSWER

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

1. Your code should yield an error because you have not defined y.

here are two ways to define output y, error e and normalized mean square error NMSE (= 1-Rsquare)

1. [ net tr ] = train(net,x,t);
y = net(x);
e = t-y;
2. [ net tr y e ] = train(net,x,t); % My favorite

then, in general,

NMSE = mse(e)/mean(var(t',1))

or for 1-dimensional outputs

NMSE =  mse(e)/var(t,1)

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source
Technical Source

Written by Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.

No responses yet