Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abarbu/ad
Chicken egg that implements automatic differentiation
https://github.com/abarbu/ad
Last synced: 25 days ago
JSON representation
Chicken egg that implements automatic differentiation
- Host: GitHub
- URL: https://github.com/abarbu/ad
- Owner: abarbu
- Created: 2012-12-07T18:56:24.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2017-05-28T16:30:08.000Z (over 7 years ago)
- Last Synced: 2024-04-15T01:18:13.242Z (7 months ago)
- Language: Scheme
- Size: 13.7 KB
- Stars: 8
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.chickenwiki
Awesome Lists containing this project
README
[[tags: egg data]]
[[toc:]]This page is maintained in the package's
[[https://github.com/abarbu/AD|github repository]].== AD
This is a Chicken Scheme egg which implements automatic
differentiation by lifitng mathematical operations. This egg uses a
hack to declare all lifted operations as both a macro and a
procedure. The macro provides specialization for the two-argument
case. This package originates in Jeff Siskind's QobiScheme.==== Derivatives
(derivative-R f)
(derivative-F f)These take a function ''f'' from a real number to a real number and
produce a function which returns the derivative of ''f''. Both forward
and reverse mode are supported.(gradient-R f)
(gradient-F f)As above but these take functions that accept a vector of reals and
return a real number. This will produce a vector of partial
derivatives. Both forward and reverse mode are supported.==== Operations
+ - * / = > < >= <= add1 sub1 signum exp log sin cos atan expt sqrt abs
max min positive? negative? odd? even? zero? real? exact? inexact?
inexact->exact exact->inexact finite?These operations are lifted.
tan acos asin quotient modulo remainder numerator denominator gcd lcm
floor ceiling truncate roundThese operations are not lifted.
(lift-real->real f df/dx x)
(lift-real*real->real f df/dx1 df/dx2 x1 x2)These are useful if you want to lift your own functions. They take the
original function, functions that produce partial derivatives and
values for each of the arguments of the original function.=== Examples
((derivative-F (lambda (x) (* x x))) 2)
=> 4.0((gradient-F (lambda (x) (+ (* (vector-ref x 0) (vector-ref x 0))
(/ (vector-ref x 1) (vector-ref x 1)))))
'#(2 3))
=> #(4.0 0.0)=== License
Copyright 1993-1995 University of Toronto. All rights reserved.
Copyright 1996 Technion. All rights reserved.
Copyright 1996 and 1997 University of Vermont. All rights reserved.
Copyright 1997-2001 NEC Research Institute, Inc. All rights reserved.
Copyright 2002-2012 Purdue University. All rights reserved.Contact Andrei Barbu, [email protected].
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see http://www.gnu.org/licenses.