Borrar filtros
Borrar filtros

How to change the performance function of neural network to mean absolute relative error

23 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Kamuran Turksoy
Kamuran Turksoy el 4 de Mayo de 2017
Editada: Kamuran Turksoy el 4 de Mayo de 2017
I found my own answer for the performance function myperf = mse(1-y./t) as follows:
net.performFcn='mse'; % this is the default setting
net= train(net,x,t,{},{},1./t); % x is the input matrix.
Note: As pointed out by Greg, t is assumed to have nonzero values.
  1 comentario
Jinlong Fu
Jinlong Fu el 8 de Jun. de 2019
Editada: Jinlong Fu el 8 de Jun. de 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

Iniciar sesión para comentar.

Más respuestas (1)

Greg Heath
Greg Heath el 28 de Abr. de 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 comentario
Kamuran Turksoy
Kamuran Turksoy el 28 de Abr. de 2017
Editada: Kamuran Turksoy el 28 de Abr. de 2017
In my application t cannot be 0.
I could use myperf = mse(1-y./t) or myperf = mse((t-y)./t).
The question is how to use myperf during the model training?

Iniciar sesión para comentar.

Categorías

Más información sobre Sequence and Numeric Feature Data Workflows 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!

Translated by