Why does my neural network enter into an infinite loop during Levenberg-Marquardt training when using the Neural Network Toolbox 4.0 (R12)?

4 views (last 30 days)
I created a neural network and set its "trainFcn" property to "Levenberg-Marquardt". When I train the network, training becomes stuck on one epoch indefinitely.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
This is a bug the way the TRAINLM function updates the step size in the Neural Networks Toolbox 4.0 (R12) . This has been fixed in version 4.0.2 (R13) of the Neural Networks Toolbox.
To fix the problem in previous releases, change lines 323 through 326 in
$MATLABROOT\toolbox\nnet\nnet\trainlm.m,
where $MATLABROOT is your root MATLAB directory, from the following:
break;
if (mu < 1e-20)
mu = 1e-20;
end
to this:
if (mu < 1e-20)
mu = 1e-20;
end
break

More Answers (0)

Community Treasure Hunt

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

Start Hunting!