[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Toon-members] TooN + automatic differentiation
From: |
Gerhard Reitmayr |
Subject: |
[Toon-members] TooN + automatic differentiation |
Date: |
Sun, 18 Apr 2010 11:57:31 +0200 |
Hi,
I just checked in experimental support for using TooN with FADBAD++
http://www.fadbad.com/fadbad.html
see TooN/functions/fadbad.h and TooN/test/fadbad.cpp for a simple example
This is a header file only library implementing automatic differentiation using
data types that replace buildin ones (such as double or float) and keep track
of derivatives during the computation. This is essentially an implementation of
ideas that were floating around for a long time.
Due to TooN's support for a precision type, it was rather straightforward to
drop it in. Some fixes I needed to make:
- make SXX more flexible with respect to products of different types so you can
multiply a differentiating precision type with a normal one
- make some use of operators explicit, because there can be some ambiguities
with FADBAD operators that also are happy to take any second type. this is a
bit annoying.
It supports forward mode where derivatives are calculated along with the
function values, and backward mode where a tree of operations is kept and
evaluated afterwards. Currently, I have only implemented helper functions for
forward mode, but backward mode could be very similar. Also, I am just using a
dynamically sized version of the differentiating datatype, it would also be
possible to use template parameter to set the number of partial derivatives to
keep track off.
Let me know, what you think about this. It's not meant to be the most efficient
way of computing derivatives but it is exact and automatic and could therefore
serve well for initial implementations and as a reference.
cheers,
Gerhard
--
Gerhard Reitmayr
Institute for Computer Graphics and Vision
http://www.icg.tugraz.at/Members/gerhard
tel: ++43 316 873 5082
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Toon-members] TooN + automatic differentiation,
Gerhard Reitmayr <=