forum.alglib.net
http://forum.alglib.net/

minlbfgs conversion problem.
http://forum.alglib.net/viewtopic.php?f=2&t=614
Page 1 of 1

Author:  kryp33 [ Tue Sep 18, 2012 2:48 am ]
Post subject:  minlbfgs conversion problem.

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

Author:  kryp33 [ Wed Sep 19, 2012 7:58 pm ]
Post subject:  Re: minlbfgs conversion problem.

Hi All,
I added the call minlbfgssetstpmax and finally got a correct results.
Problem solved.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/