Neural Network - How to use a custom training function
7 views (last 30 days)
Is it possible to replace standard matlab training methods (like Gradient Descent, Levenberg-Marquardt, etc.) by other methods of global optimization, like Particle Swarm Optimization or Simulated Annealing?
I was looking at C:\Program Files\MATLAB\R2018a\toolbox\nnet\nnet\nntrain\... for some clues, but nothing comes up...
Attached are two original files of the mentioned training functions ( traingd and trainlm ).
Greg Heath on 25 Mar 2018
Use the help and doc commands on
There may be more, my website search using "trainfcn" was very brief.
Thank you for formally accepting my answer
Sumaiya Ahmad on 10 Sep 2019
Edited: Sumaiya Ahmad on 10 Sep 2019
I have not tried, but I think it might work,
Please try the following command:
net.trainFcn = 'custom_function_name';
net is your network name.
trainFcn is property to the name of the corresponding function
custom_function_name is training function defined by you
(I hope it might help you)