Neural Network - How to use a custom training function

7 次查看(过去 30 天)
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 ).

回答(2 个)

Greg Heath
Greg Heath 2018-3-25
Use the help and doc commands on
trainru
trainb
trainr
trainc
trains
trainbu
trainscg
traingdx
traingdm
traingd
trainbr
traingda
There may be more, my website search using "trainfcn" was very brief.
Thank you for formally accepting my answer
Greg
  2 个评论
David Franco
David Franco 2018-3-25
Yeah, I know all of these training functions.
My question is: Can I use my own custom training function and replace these MATLAB inbuilt?
Thanks!

请先登录,再进行评论。


Sumaiya Ahmad
Sumaiya Ahmad 2019-9-10
编辑:Sumaiya Ahmad 2019-9-10
I have not tried, but I think it might work,
Please try the following command:
net.trainFcn = 'custom_function_name';
where
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)

类别

Help CenterFile Exchange 中查找有关 Pattern Recognition and Classification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by