How to change the performance function of neural network to mean absolute relative error
14 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Kamuran Turksoy
am 26 Apr. 2017
Bearbeitet: Jinlong Fu
am 8 Jun. 2019
Hello,
I know the Matlab NN toolbox has MSE, SSE, MAE and SAE performance functions but would like to implement a custom performance function as:
myperf=mean(abs((t-y)./t));
where t is the target output vector and y is the NN output.
Any thoughts on how can this be implemented?
Thanks in advance.
2 Kommentare
Akzeptierte Antwort
Kamuran Turksoy
am 4 Mai 2017
Bearbeitet: Kamuran Turksoy
am 4 Mai 2017
1 Kommentar
Jinlong Fu
am 8 Jun. 2019
Bearbeitet: Jinlong Fu
am 8 Jun. 2019
In my view, it should be as follows:
net.performFcn='mse'; % mean suqare error
net= train(net,x,t,{},{},1./t.^2); % 1./t.^2 is the error weight
or
net.performFcn='mae'; % mean absolut error
net= train(net,x,t,{},{},1./t); % 1./t is the error weight
Weitere Antworten (1)
Greg Heath
am 28 Apr. 2017
You have at least 2 obstacles:
1. When t --> 0
2. abs is not differentiable
If t --> 0 is not a problem try
myperf = mse( 1-y./t);
Hope this helps.
Thank you for formally accepting my answer
Greg
1 Kommentar
Siehe auch
Kategorien
Mehr zu Sequence and Numeric Feature Data Workflows finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!