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!