How to customize performance functions(Neural Network)

16 ビュー (過去 30 日間)
杰 李
杰 李 2022 年 7 月 19 日
コメント済み: Baker Shehadeh 2023 年 1 月 26 日
I would like to train a network by writing a new custom performance function. Here's how to customize the performance function. As explained above, the best way to create a custom performance function by using "mse.m:" and the +MSE function package as a template, that is, consider using the template provided by "+mse" to create a new package "+newfcn".
This is the contents of the `+mse` folder. What makes up the cost function seems to be structured in these atom functions. However, their exact roles are unclear.
ls +mse
apply.m backprop.m forwardprop.m perfwb.m
name.m type.m normalize.m parameterInfo.m
dperf_dwb.m perfw_to_ew.m
Since the code is simple and uncommented, it's hard for me to understand how they implement the functionality. Also, for reference, `apply`, `backprop`, and `forwardprop` functions are concatenated below:
function perfs = apply(t,y,e,param)
%MSE.APPLY
perfs = e .* e;
end
function dperf = forwardprop(dy,t,y,e,param)
%MSE.FORWARDPROP
dperf = bsxfun(@times,dy,-2*e);
end
function dy = backprop(t,y,e,param)
%MSE.BACKPROP
dy = -2*e;
end
I'm having a hard time trying to understand how these work together to compose a Mean Squared Error function. It seems like the classical implementation of MSE was decomposed into steps to achieve more flexibility, but combined with no documentation it's become very hard to understand.
What are the roles of the cost function's subfunctions, and how they should be implemented? Where do I need to modify the code if I want to implement a custom performance function?
Thanks in advance.
  2 件のコメント
Daniel Ciesluk
Daniel Ciesluk 2022 年 9 月 4 日
I'm trying to do the same thing and there is completely no information on how to do this.
Baker Shehadeh
Baker Shehadeh 2023 年 1 月 26 日
Hi, did you solve your problem? I'm having the exact issue

サインインしてコメントする。

回答 (1 件)

David Willingham
David Willingham 2022 年 9 月 6 日
Hi,
The code you refer to above is referencing the older classic neural networks framework, which is primarily used for shallow neural networks.
We have a newer, updated framework for deep learning that allows you to fully customize how yo can train a model. More information on this can be found here.
Can you provide more information on the network you are looking to customize?

カテゴリ

Help Center および File ExchangeDeep Learning Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by