How to custom the perform function using neural network toolbox?

1 次查看(过去 30 天)
I am using MATLAB R2015a and I would like to train a neural network with my own perform function. I followed all steps described in forums to do it :
1) I copied the mse.m and +mse folder from inside the matlab directory to my working directory and i renamed them as mymse.m and +mymse
2) I modified the function name inside the mymse.m file from:
function perf = mse(net,varargin)
to
function perf = mymse(net,varargin)
then building the net, i added my own performance function as
net.performFcn = 'mymse'
3) I left the .m functions inside the +mymse folder as they are since mymse function computes the mse. Note that I do not change mymse.m as I wish it, before changing the perform function I would like the program works by integrating mymse.m (working exactly like mse.m).
Finally the code doesn't work at all and I don't understand why. The result is always a flatline or crashes.
Could you help me in this task.
Thank you
Vincent

采纳的回答

Søren Jensen
Søren Jensen 2015-4-29
Im by far not an expert, but here's what i would do:
1) make sure the directory you are working in is the right one
2) try copying your mymse.m files to the original matlab directory.. maybe the net can only search for performance functions here?
I don't know if you if you really need a custom performance function but if you surrender to matlab, here's a list of the premade performance functions:
mae - Mean absolute error performance function.
mse - Mean squared error performance function.
sae - Sum absolute error performance function.
sse - Sum squared error performance function.
  1 个评论
Vincent RICHARD
Vincent RICHARD 2015-4-29
Ok it works! thank you Soren.
I would like now to change the template 'mymse.m' to built my own perform function. The obectif is to optimize the phase error generated by the two outputs of the networks.
Do you have an idea where we have to integrate it in the code 'mymse'?
Thank you in advance
Vincent

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Data Workflows 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by