MSE result is too high
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a 122x499 dataset, consisting of -1, 0, and 1 value. I made a neural network using "nntool" which uses Feedforward backprop, 2 hidden layer, the first layer having 100 hidden neuron and the second as output layer. I then trained the network using these parameters:
rng('default')
network1.divideFcn = 'dividerand';
network1.divideParam.trainRatio = 0.7;
network1.divideParam.valRatio = 0.15;
network1.divideParam.testRatio = 0.15;
network1.trainParam.epochs = 10000;
network1.trainParam.lr = 0.01;
network1.trainParam.mc = 0.9;
% Train the Network
[net,tr] = train(network1,input,output);
% Test the Network
y = net(input);
e = gsubtract(output,y);
mse = perform(net,output,y)
accuracy = 1-(0.5*mean(abs(e./(abs(output)+abs(y)))))
Now, for some reason I get MSE value of 1.4188.. As far as I know MSE only goes up to 1 right? The same thing happens when I use 200 neuron, MSE value went up to 1.5594.. But when I increased the neuron to 500, MSE goes down to 0.5852.. Did I do something wrong here? Is my MSE equation wrong? Please help!
0 comentarios
Respuestas (1)
Greg Heath
el 28 de Mzo. de 2018
Editada: Greg Heath
el 28 de Mzo. de 2018
1. GUESS: fitnet ?
2. Unnecessary assignments of default values to
divideFcn and ratios.
3. Erroneous use of "output" instead of "target"
4. Inadvisable normalization. Normalize using the
mse from the simple case where the target
is constant and the corresponding mse is the
variance:
e = target - output;
NMSE = mse(e)/mean(var(target',1))
% NMSE = mse(e)/var(target) for 1-dim
which yields
Rsquare = 1 - NMSE % R^2
See Wikipedia for an extensive discussion of Rsquare.
Hope this helps.
Thank you for formally accepting my answer
Greg
Ver también
Categorías
Más información sobre Define Shallow Neural Network Architectures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!