Adept (C++ library) explained
Adept C++ Library |
Logo Size: | 300 |
Developer: | Robin Hogan |
Latest Release Version: | 2.1 |
Programming Language: | C++ |
Operating System: | Cross-platform |
Genre: | Library |
License: | Apache 2.0 (open source) |
Adept is a combined automatic differentiation and array software library for the C++ programming language. The automatic differentiation capability facilitates the development of applications involving mathematical optimization. Adept is notable for having applied the template metaprogramming technique of expression templates to speed-up the differentiation of mathematical statements.[1] [2] Along with the efficient way that it stores the differential information, this makes it significantly faster than most other C++ tools that provide similar functionality (e.g. ADOL-C, CppAD and FADBAD),[1] [3] [4] [5] [6] although comparable performance has been reported for Stan and in some cases Sacado.[3] Differentiation may be in forward mode, reverse mode (for use with a Quasi-Newton minimization scheme), or the full Jacobian matrix may be computed (for use with the Levenberg-Marquardt or Gauss-Newton minimization schemes).
Applications of Adept have included financial modeling,[6] [7] computational fluid dynamics,[8] physical chemistry,[9] parameter estimation[10] and meteorology.[11] Adept is free software distributed under the Apache License.
Example
Adept implements automatic differentiation using an operator overloading approach, in which scalars to be differentiated are written as adouble
, indicating an "active" version of the normal double
, and vectors to be differentiated are written as aVector
. The following simple example uses these types to differentiate a 3-norm calculation on a small vector:
- include
- include
int main(int argc, const char** argv) When compiled and executed, this program reports the derivative as:dJ/dx =
See also
External links
Notes and References
- Hogan. Robin J.. Fast reverse-mode automatic differentiation using expression templates in C++. ACM Trans. Math. Softw.. 2014. 40. 4. 26:1–26:16. 10.1145/2560359. 9047237.
- Andreas. Griewank. 2014. On automatic differentiation and algorithmic linearization. Pesquisa Operacional. 34. 3. 621–645. 10.1590/0101-7438.2014.034.03.0621. free.
- Bob. Carpenter. The Stan Math Library: Reverse-Mode Automatic Differentiation in C++. 1509.07164. cs.MS. 2015.
- Web site: Sensitivities in Quantitative Finance: Libor Swaption Portfolio Pricer (Monte-Carlo). 2017-10-21. 2016-12-02.
- Discrete controls and constraints in optimal control problems. PhD Thesis. Matthias. Rieck. Technical University of Munich. 2017-10-21.
- Stochastic volatility models with applications in finance. https://web.archive.org/web/20170718074806/http://ir.uiowa.edu/cgi/viewcontent.cgi?article=6780&context=etd. dead. July 18, 2017. Ze. Zhao. 2017-10-27. University of Iowa.
- Gilles. Pagès. Olivier. Pironneau. Guillaume. Sall. Vibrato and automatic differentiation for high order derivatives and sensitivities of financial options. 1606.06143. q-fin.CP. 2016.
- T.. Albring. M.. Sagebaum. N. R.. Gauger. 2016. A Consistent and Robust Discrete Adjoint Solver for the SU2 Framework—Validation and Application. A.. Dillmann. G.. Heller. E.. Krämer. C.. Wagner. C.. Breitsamter. New Results in Numerical and Experimental Fluid Mechanics X. Notes on Numerical Fluid Mechanics and Multidisciplinary Design. 132. Springer, Cham. 10.1007/978-3-319-27279-5_7.
- Kyle E.. Niemeyer. Nicholas J.. Curtis. Chih-Jen. Sung. pyJac: Analytical Jacobian generator for chemical kinetics. Comput. Phys. Commun.. 215. 2017. 188–203. 1605.03262. 2017CoPhC.215..188N. 10.1016/j.cpc.2017.02.004. 19675513.
- Boosting Bayesian parameter inference of nonlinear stochastic differential equation models by Hamiltonian scale separation. Carlo. Albert. Simone. Ulzega. Ruedi. Stoop. Phys. Rev. E. 93. 43313. 043313. 2016. 1509.05305. 10.1103/PhysRevE.93.043313. 27176434. 2016PhRvE..93d3313A. 4479221.
- S.. Mason. J.-C.. Chiu. R. J.. Hogan. D.. Moisseev. S.. Kneifel. Retrievals of riming and snow particle density from vertically-pointing Doppler radars. J. Geophys. Res.. 123. 10.1029/2018JD028603. 2018. free.