forum.alglib.net

ALGLIB forum
It is currently Mon Dec 23, 2024 5:37 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  [ 2 posts ] 
Author Message
 Post subject: minlbfgs conversion problem.
PostPosted: Tue Sep 18, 2012 2:48 am 
Offline

Joined: Tue Sep 18, 2012 2:26 am
Posts: 2
Hello All,

I just started to use AlgLib 3.6.0 in C++ incarnation, so I may be missing something simple. Can you, please, help me with this problem:

I am trying to use function minlbfgs to find a minimum given the user defined function callback which returns a func and grad's.
The way how I sue it:

real_1d_array x;
x.setcontent(initTheta.size(),initTheta.memptr()); //All zeros

minlbfgscreate(1, x, state);
minlbfgssetcond(state, 0, 0, 0, m_nIterrations);
alglib::minlbfgsoptimize(state, fnCostLogReg,0,this);
minlbfgsresults(state, x, rep);

I noticed(in debugger) that on the second iteration the real_1d_array &x parameter in the call back function has got changed values for the next iteration. But these values are too large. I compare them with the same code I have in Octave and they are exactly 10 times bigger. This break my convergence. I am not sure how this algorithm works internally, but if I use an analogy with standard gradient descend method, then I have a feeling that there should be some parameter(lambda) that regulates the step of descend. Is there something I forgot to set up in minlbfgsoptimize?

Thanks a lot,
Sergey Andreyev


Top
 Profile  
 
 Post subject: Re: minlbfgs conversion problem.
PostPosted: Wed Sep 19, 2012 7:58 pm 
Offline

Joined: Tue Sep 18, 2012 2:26 am
Posts: 2
Hi All,
I added the call minlbfgssetstpmax and finally got a correct results.
Problem solved.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 16 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