[CppAD] Using existing derivative code combined with AD

Piotr Dobaczewski piotr.dobaczewski at ibs.org.pl
Fri Mar 15 04:37:54 EDT 2013


Hi Brad,

I think, I am looking for something you've described.

I would like to use AD to compute derivatives of expressions of form: 
f(g(h(x))),
where f and h are tractable using AD (e.g. I have the source code), while g
is not. For g, I can only evaluate it and its derivatives for given x. 
How does
one plug direct function and derivative evaluation into CppAD, assuming one
is given pointers to functions evaluating g and its derivatives?

Best Regards
Piotr Dobaczewski

Original message:

 > Perhaps Dominik's reply below answered your question, or perhaps you
 > were looking for something simpler. For example, use AD to compute
 > derivatives of f(g, x, y) and then use the change rule, and your
 > knowledge of the derivatives of g, to get the derivatives of f[ g(x), x,
 > y ] ?

 > Am Mittwoch, den 05.01.2011, 14:53 +1100 schrieb Scott Foster:
 >> Hi,
 >>
 >> I have a function of the form f(g(x),x,y), which has a scalar outcome.
 >> The function g(x) requires iteration and can't be auto-differentiated
 >> easily but its derivative can be found using other methods (numerical).
 >>     The function f(.,.,.) is pretty horrible in itself but it is a
 >> predefined sequence of operations and is an ideal candidate for AD.
 >>
 >> So, what I want to do is to use AD to differentiate f(.,.,.) but to tell
 >> CppAD, somehow, to use the hard-wired code whenever it comes across
 >> g(x).  I do not know how to do this.  It is what I want to learn how 
to do.
 >>
 >> I'm assuming that this is a pretty common problem but I haven't been
 >> able to find any mention in the documentation.  Of course, that doesn't
 >> mean that it isn't there -- just that I haven't found it:-)
 >>
 >> Any help would be very appreciated.
 >>
 >> Scott
 >>
 >
 > _______________________________________________
 > CppAD mailing list
 > CppAD at list.coin-or.org
 > http://list.coin-or.org/mailman/listinfo/cppad
 >

-- 
Pozdrawiam
Piotr Dobaczewski




More information about the CppAD mailing list