How to implement the rmse as a performance function for a neural network

1 visualización (últimos 30 días)
I would like to use the rmse as the performance function for my neural network, instead of the mse. I use the default code from the NN toolbox in Matlab. As the rmse isn't implemented in Matlab I try to set it up myself (see net.performFcn) . To do so I need access to the output of the NN in the workspace, which appears only after training and testing the NN. However the performance function is needet to train the network.. How can I work around this? Or what do I need to do to implement the rmse properly? I already searched Matlab answers and the documentation.
...
% Setup Division of Data for Training, Validation, Testing
net.divideParam.trainRatio = 70/100;
net.divideParam.valRatio = 15/100;
net.divideParam.testRatio = 15/100;
net.trainParam.max_fail = 6;
net.trainParam.epochs = n;
Z=cell2mat(T);%target
net.performParam.normalization = 'standard';
net.performFcn=sqrt(sum((Z(:)-t1_Output1(:)).^2)/numel(Z));
% Train the Network
[net,tr] = train(net,x,t,xi,ai);
% Test the Network
y = net(x,xi,ai);
e = gsubtract(t,y);
performance_ol = perform(net,t,y);
...

Respuestas (0)

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows en Help Center y File Exchange.

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by