- Define a custom performance function that calculates the absolute error for each prediction and checks if it is within a threshold.
- Modify the neural network training process to use this custom function by setting it in the network's performance function property.
- Implement the custom function in MATLAB by creating a new function file and assigning it to the network's "performFcn" property.
- Ensure the custom function outputs the performance value and its derivative for backpropagation during training.
Change the minimization function in Neural Network
2 ビュー (過去 30 日間)
古いコメントを表示
I searched a lot in the other questions, but I did not find something working for me.
I would like to change the default function during the NN training (that is, 'mse') to just the minimization of the absolute value of the absolute error between the output of the NN 'y' and the real output 't'. In other words, I want something like:
myperf = abs(y(i) - t(i))<= 0.4; for each i
thus, without the "mean", without the "square" and considering the minimization of each i-th error, and not the sum of them.
Thanks for helping me
0 件のコメント
回答 (1 件)
Himanshu
2024 年 10 月 4 日
編集済み: Himanshu
2024 年 10 月 4 日
Hello,
I see that you are trying to customize the performance function in a neural network to minimize the absolute error for each individual prediction instead of using the default mean squared error.
You can follow the below steps to achieve this:
Please refer to the below documentation for more information.
Neural Network Object Properties - "net.performFcn": https://www.mathworks.com/help/deeplearning/ug/neural-network-object-properties.html#bss4hk6-52
I hope this helps.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Deep Learning Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!