Neural net work code

9 views (last 30 days)
Veen Qas
Veen Qas on 22 Apr 2022
Hi, I am not expert in NNT modeling , but I am trying to train a set of data, I have two inputs and 3 outputs, for now I am using one layer with 7 neurons. The program is running but I can not understand the results and I can not see how my output is matching the original data , I tried to take the trained output to excel but I got confused as I was not sure this output corresponds to which original data
your help is appreciated
hiddenlayersize=7;
net=fitnet(hiddenlayersize);
net.divideParam.trainRatio=80/100;
net.divideParam.valRatio= 10/100;
net.divideParam.testRatio=10/100;
xn=x';
Yn=Y';
[net,tr]=train(net,xn,Yn);
Ytrain=net(xn(:,tr.trainInd));
YtrainTrue=Yn(tr.trainInd);
sqrt(mean(Ytrain-YtrainTrue).^2);
Yval=net(xn(:,tr.valInd));
YvalTrue=Yn(tr.valInd);
sqrt(mean(Yval-YvalTrue).^2);
%plot(YvalTrue,Yval,'0'); hold on
plot(YtrainTrue,Ytrain,'o',YvalTrue,Yval,'*'); hold on
plot(0:30,0:30); hold off
save net

Answers (0)

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!