On Mar 8, 2011, at 2:14 PM, Gregory Maxwell wrote:

On Tue, Mar 8, 2011 at 2:05 PM,  <[email protected]> wrote:
PS. You can probably save a few more function evaluations if you
check for repeated calls with the same arguments. The reason is
that, on the line search, SLSQP often calls your function twice at
the end of the line search: once without the gradient, and then once
more (when it realizes ex post facto that the line search is done)
with the gradient.

Yes, I have noticed that. Unfortunately, I cannot make use of
this fact. I use automatic differentiation for the gradients, so
computing the derivative involves computing the function anyway.

Perhaps a dumb question— but why are you using automatic differentiation
instead of using a gradient free algorithm?

Are the gradient free algorithims in NLOPT really so poor for your
application that
automatic differentiation + a with-gradient algorithm is superior?

Assuming Peter is using standard terminology, automatic differentiation does *not* mean numerical differentiation with finite differences. Automatic differentiation means calculating the exact derivative analytically, just using a computer program rather than doing it by hand: an AD differentiaties your source code symbolically.

So, automatic differentiation can in principle be the same efficiency as programming analytical derivatives by hand, and with it the gradient-based algorithms are probably far superior to the derivative- free algorithms for this many unknowns.

In principle, since AD takes source code to compute an objective and generates source code to compute objective+gradient, you could possibly edit the resulting code to remove stuff only needed for the computation of the objective. But editing program-generated code by hand is messy, and is fragile because you need to re-do it each time you change your objective, so I can understand why Peter wouldn't want to do it.

Steven
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss

Reply via email to