forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 6:42 pm

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: some help with minlmoptimize please
PostPosted: Tue Dec 06, 2011 9:09 pm 
Offline

Joined: Tue Dec 06, 2011 8:58 pm
Posts: 1
Hi folks,

I wanted to get some help with regards to the use of the minlmoptimize Lev-Marq. optimization function from ALGLIB.

I am using the FGH mode, so where the function is not in terms of sums of square residuals but in therms of cost_Function val, Gradient and Hessian.

I've used


minlmoptimize(state, costfn_func, costfn_grad, costfn_hess, costfn_rep, &dataIn);


inside my class following the "minlm_d_fgh" example example that comes with the documentation and everything works nice and well and everyone is happy.




What I really dont understand is why inside all the callback methods "costfn_func", "costfn_grad" and "costfn_hess" everything has to be redefined and recalculated.

So inside the gradient function "costfn_grad" the cost function has to be recalcuated, and inside the Hessian function "costfn_hess" both the gradient and the cost function have to be recalculated. Just like in the example
http://www.alglib.net/translator/man/ma ... inlm_d_fgh

the func and grad are recalculated in the hessian, and the func are recalculated in the gradient.

Is there any reason for that?
It seems a bit wastefull doesnt it?


I know that if I remove the additional recalculations the optmisation does not work any more.

Any help would be appreciated.

Thanks


Top
 Profile  
 
 Post subject: Re: some help with minlmoptimize please
PostPosted: Thu Dec 08, 2011 5:41 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
At some points algorithm needs function value only, at another ones it needs gradient information. It is too slow to calculate function value and all its derivatives when you need function value only, so algorithm accepts several callbacks - "heavy" one which calculates everything and "quick" one which allows to look at the value of the function without too much of the effort.


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 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group