Info

This question is closed. Reopen it to edit or answer.

How to modify a built-in in function that is a parameter of another like functionA('functionB') AKA use a custom training function for a neural network

1 view (last 30 days)
The network creation
net = feedforwardnet([50],'traingd');
called the function traingd.m, there is a set of these functions.
Now I want a custom trainFunction but they does not allow me to create a function with another name
net = feedforwardnet([50],'trainscgXX');
Error using feedforwardnet (line 68)
FCN does not return an info object.
There is a suggestion like
% To change a neural network's training algorithm set the net.<a href="matlab:doc nnproperty.net_trainFcn">trainFcn</a>
% property to the name of the corresponding function. For example, to use
% the scaled conjugate gradient backprop training algorithm:
%
% net.<a href="matlab:doc nnproperty.net_trainFcn">trainFcn</a> = '<a href="matlab:doc trainscg">trainscg</a>';
I can't understand how to make it, it seems that there is a limited number of function that it can accept as input, and I don't know how to add also mine.
Thanks
p.s. I know that I can modify one of the one that works, but that is not the choice I want to make

Answers (0)

Community Treasure Hunt

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

Start Hunting!