MATLAB Answers

Displaying MSE values at training,validation and testing ratios

23 views (last 30 days)
bryce maher
bryce maher on 23 Feb 2020
Answered: Vimal Rathod on 26 Feb 2020
Just started learning about neural networks and have been using the neural net fitting tool box. I've taken the code and tried adding an extra layer which has been successful but i dont know how to find these MSE values?
heres my code:
% Solve an Input-Output Fitting problem with a Neural Network
% Pressure - input data.
% Output - target data.
input=xlsread('NEW DATA.xlsx',1,'E7:E39');
x = input';
output=xlsread('NEW DATA.xlsx',1,'H7:I39');
t = output';
% Choose a Training Function
trainFcn = 'trainlm'; % Levenberg-Marquardt backpropagation.
% Create a Fitting Network
hiddenLayer1Size = 80;
hiddenLayer2Size = 40;
net = fitnet([hiddenLayer1Size hiddenLayer2Size],trainFcn);
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 80/100;
net.divideParam.valRatio = 5/100;
net.divideParam.testRatio = 15/100;
% Train the Network
[net,tr] = train(net,x,t);
% Test the Network
y = net(x);
e = gsubtract(t,y);
performance = perform(net,t,y)
view(net)

  0 Comments

Sign in to comment.