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
0 个评论
采纳的回答
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.
更多回答(0 个)
另请参阅
类别
在 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!