How to change the performance function of neural network to mean absolute relative error
조회 수: 5 (최근 30일)
이전 댓글 표시
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.
채택된 답변
Kamuran Turksoy
2017년 5월 4일
편집: Kamuran Turksoy
2017년 5월 4일
댓글 수: 1
Jinlong Fu
2019년 6월 8일
편집: Jinlong Fu
2019년 6월 8일
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
추가 답변 (1개)
Greg Heath
2017년 4월 28일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Sequence and Numeric Feature Data Workflows에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!