<div dir="ltr">Hi,<div><br></div><div>Thanks for the reply. I will try your suggestion and post again to inform whether the issue has been resolved.</div><div><br></div><div>Best,</div><div>Shantanu</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 February 2015 at 18:59, Kshitij Kulshreshtha <span dir="ltr"><<a href="mailto:kshitij@math.upb.de" target="_blank">kshitij@math.upb.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
you could try the following:<br>
<br>
Firstly compute the 1-D optimal point without the use of ADOL-C with<br>
simple double variables. Once you have the optimal point, evaluate the<br>
interpolation at this point within trace_on() trace_off() using adouble<br>
variables. Then you can call gradient() and get the derivative of the<br>
function at the optimal point.<br>
<br>
This means that you need to recreate the trace after each 1-D<br>
optimization step.<br>
<br>
The gradient() function results in a zero gradient under two conditions:<br>
It does not see the whole dependency graph due to programming error, or<br>
you are evaluating the derivative w.r.t. the optimization variables at<br>
the local optimal point. In the second case getting an exact zero is<br>
rather unusual, you should get some very small numbers around machine<br>
precision.<br>
<br>
Best wishes<br>
Kshitij.<br>
<div><div class="h5"><br>
On 2015-02-20 16:18, Shantanu MULLICK wrote:<br>
> Hello,<br>
><br>
> I've started using ADOL-C for about a month, so I'm just about a beginner.<br>
> I need to differentiate a function which requires me to first compute a<br>
> 3-D interpolation, and then do a 1-D optimization using Brent's<br>
> algorithm. I want to know if I can use ADOL-C to differentiate a<br>
> function like this.<br>
><br>
> I'm particularly concerned by the 1-D optimisation that my function<br>
> performs. It would probably be important to see how the 1-D optimiser is<br>
> coded to decide if ADOL-C can work on it. The C code for the 1-D<br>
> optimizer using Brent's algorithm can be found<br>
> here: <a href="http://people.sc.fsu.edu/~jburkardt/c_src/brent/brent.c" target="_blank">http://people.sc.fsu.edu/~jburkardt/c_src/brent/brent.c</a> ( I use<br>
> the function "local_min").<br>
><br>
> There was a previous query on performing ADOL-C on linear interpolation<br>
> (<a href="http://list.coin-or.org/pipermail/adol-c/2012-December/000881.html" target="_blank">http://list.coin-or.org/pipermail/adol-c/2012-December/000881.html</a>). I<br>
> guess I can adapt the answer given here to perform 3-D linear interpolation.<br>
><br>
> I have another question. I previous tried to treat the interpolation and<br>
> the optimizer part of the function as "constants" (not adoubles ). When<br>
> I do this, and use the "gradient" driver to find the derivative, I get<br>
> all zeros as a result ( Despite the "gradient" driver saying that the<br>
> function is locally analytic). My question is what are the most common<br>
> reasons that would lead ADOL-C to return zeros while using the<br>
> "gradient" driver.<br>
><br>
> Thanks in advance!<br>
><br>
> Shantanu,<br>
><br>
> PhD Candidate at ESSEC<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> ADOL-C mailing list<br>
> <a href="mailto:ADOL-C@list.coin-or.org">ADOL-C@list.coin-or.org</a><br>
> <a href="http://list.coin-or.org/mailman/listinfo/adol-c" target="_blank">http://list.coin-or.org/mailman/listinfo/adol-c</a><br>
><br>
<br>
--<br>
Dr. Kshitij Kulshreshtha<br>
<br>
Institut für Mathematik,<br>
Universität Paderborn,<br>
Warburger Straße 100,<br>
33098 Paderborn.<br>
<br>
Büro: A3.235<br>
<br>
Privatanschrift:<br>
Arnikaweg 62<br>
33100 Paderborn.<br>
</blockquote></div><br></div>