Skip to content

Automatic differentiation library for Common Lisp

Notifications You must be signed in to change notification settings

mobius-eng/cl-ad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CL-AD

Automatic (algorithmic) differentiation library for Common Lisp. It is based on Scheme library but is implemented in a more generic way using CLOS.

What is "automatic (algorithmic) differentiation (AD)"?

AD rerers to the method of calculating numerical derivatives analytically, but not symbolically. A general idea is to exploit the chain rule. For this the whole arithmetic of the language is replaced with slightly more generic arithmetic operations: instead of operating on numbers only, these operations can accept dual numbers or tapes and produce the derivative of the operation as well as the main result.

In essence, dual numbers are the extension of numbers with perturbations, their "derivatives". Consider function f(x). If we know it's derivative df(x), then given a dual number [z dz], the result of application of f(x) to it is a dual number [f(z) df(z)*dz]. This result can become an input to the next function g(x), producing [g(f(z)) dg(z)*df(z)*dz]. And so on. To begin the process, all we need is to set dz=1. This is called forward derivative.

TODO: reverse derivative.

Current status

Forward derivatives - complete, beta-state Reverse derivatives - TODO

Future

  • Extend it to symbolic data
  • Implement full Jacobian calculation

Examples

License

Copyright © 2016 Alexey Cherkaev (mobius-eng)

Distributed under Lesser GNU Public License 3 or (at your option) any later version.

About

Automatic differentiation library for Common Lisp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published