forum.alglib.net

ALGLIB forum
It is currently Mon Dec 23, 2024 1:02 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: L-BFGS optimisation maxits
PostPosted: Sat Feb 11, 2012 7:35 am 
Offline

Joined: Sat Feb 11, 2012 7:22 am
Posts: 1
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


Top
 Profile  
 
 Post subject: Re: L-BFGS optimisation maxits
PostPosted: Sun Feb 12, 2012 11:35 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
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)


Top
 Profile  
 
 Post subject: Re: L-BFGS optimisation maxits
PostPosted: Fri Mar 02, 2012 4:37 pm 
Offline

Joined: Fri Mar 02, 2012 4:33 pm
Posts: 1
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


Top
 Profile  
 
 Post subject: Re: L-BFGS optimisation maxits
PostPosted: Sat Mar 03, 2012 11:07 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 23 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group