TinyAD is a C++ header-only library for second-order automatic differentiation. Small dense problems are differentiated in forward mode, which allows

Search code, repositories, users, issues, pull requests...

submited by
Style Pass
2025-01-08 01:00:25

TinyAD is a C++ header-only library for second-order automatic differentiation. Small dense problems are differentiated in forward mode, which allows unrestricted looping and branching. An interface for per-element functions allows convenient differentiation of large sparse problems, which are typical in geometry processing on meshes. For more details see our paper or watch our talk.

To use TinyAD in your existing project, include either TinyAD/Scalar.hh, TinyAD/ScalarFunction.hh, or TinyAD/VectorFunction.hh.

We provide the scalar type TinyAD::Double<k> as a drop-in replacement for double. For small problems, simply choose the number of variables k and generate a vector of active variables. Then, perform computations as usual (e.g. using Eigen) and query the gradient and Hessian of any intermediate variable:

All derivative computations are inlined and thus available for compiler optimization. As no taping is needed in forward mode, any kind of run time branching is possible.

Leave a Comment