Neural net work code

9 次查看(过去 30 天)
Veen Qas
Veen Qas 2022-4-22
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Deep Learning Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by