forum.alglib.net http://forum.alglib.net/ |
|
L-BFGS optimisation maxits http://forum.alglib.net/viewtopic.php?f=2&t=536 |
Page 1 of 1 |
Author: | AlglibUser [ Sat Feb 11, 2012 7:35 am ] |
Post subject: | L-BFGS optimisation maxits |
Hi, I'm using the L-BFGS optimiser as follows: Code: double epsg = 0.01; double epsf = 0.01; double epsx = 0.01; double diffstep = 1.0e-5; int maxits = 10; alglib.minlbfgsstate state; alglib.minlbfgsreport rep; alglib.minlbfgscreatef(1, x, diffstep, out state); alglib.minlbfgssetcond(state, epsg, epsf, epsx, maxits); alglib.minlbfgssetprecscale(state); alglib.minlbfgssetstpmax(state, 1.0); alglib.minlbfgsoptimize(state, func, null, null); alglib.minlbfgsresults(state, out x, out rep); I would like to stop the optimisation after a given number of iterations, but passing different values of 'maxits' to the minlbfgs state using minlbfgssetcond() seems to have no effect. Any suggestions on how to limit the number of iterations would be appreciated. Thanks Ernest |
Author: | Sergey.Bochkanov [ Sun Feb 12, 2012 11:35 am ] |
Post subject: | Re: L-BFGS optimisation maxits |
Iterations stop after meeting at least one stopping criteria. If you want optimizer to stop after 10 iterations, you should turn off other criteria (epsg=epsf=epsx=0) |
Author: | z_shaheer [ Fri Mar 02, 2012 4:37 pm ] |
Post subject: | Re: L-BFGS optimisation maxits |
I've set my epsg=epsf=epsx = 0 and my maxits = 5. However, I'l still having 21 iterations each time I run the routine, regardless of the model I use. Any help would be appreciated. Mo |
Author: | Sergey.Bochkanov [ Sat Mar 03, 2012 11:07 am ] |
Post subject: | Re: L-BFGS optimisation maxits |
Are you sure that you have 21 iterations, not function evaluations? One iteration may need several function evaluations. From 1 per iteration to 20 per iteration. 4 evaluations per iteration seems to be reasonable amount. |
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |