Skip to main content

A Python package for forward mode automatic differentiation for multivariate functions, Jacobian/Hessian matrix computation, root-finding, and optimization routines.

Project description

hotAD

A Python package for forward mode automatic differentiation for multivariate functions, Jacobian/Hessian matrix computation, root-finding, and optimization routines.

Build Status

Coverage Status

Background

Classically, scientists have used symbolic differentiation and finite difference method to compute derivatives of functions, but these approaches face issues of increasing errors and increasing time cost in evaluating the derivatives as dimensions and complexities of the function go up. Automatic differentiation (AD) applies the chain rule - a rudimentary differentiation technique - over and over on a series of elementary arithmetic operations that make up any function. As the order increases, the complexity of AD calculation is not worse than the original function, therefore achieving efficiency.

Our Python package employs the forward mode of AD to evaluate the first and second derivatives of functions. Users are welcome to use our forward mode AD module and accompanying the elementary functions module for their own applications or to take advantage of our even more user-friendly Jacobian-calculating and optimization module.

Installation

To install, users have two options

  • Pip: pip install hotAD (coming soon)
  • Download source code: Find the code under hotAD/hotAD and the requirements in the requirements.txt file.

Usage

AutoDiffObject

Users can instantiate variables they wish to differentiate and then combine these variables into a function, which will now contain the function value and first derivative. To call vector-valued functions, simply create a list of functions. Users can specify an optional argument H=True if they wish to compute the second derivative as well.

x = AutoDiff(3, 'x') y = AutoDiff(4, 'y') f = x*y + x

ElementaryFunctions

Users are strongly recommended to use our elementary functions. Currently we have implemented:

  • trigonometric functions (sin, cos, tan, arcsin, arccos, arctan)
  • power functions (power, sqrt)
  • exponential functions (log, exp)
  • logistic function (logit)

x = AutoDiff(np.pi, 'x') y = AutoDiff(np.pi/4, 'y' f = ef.sin(x) + np.tan(y)

ADfun

Users can use the methods in this module to compute the Jacobian matrix of a function, to perform root-finding via Newton's Method, and to perform minimization via newton, quasi-newton-BFGS, and gradient-descent methods.

More information

For additional information on how to use the package, please see docs/milestone2.ipynb.

Our group members are:

  • Yuanheng Wang
  • Jiayin Lu
  • Lipika Ramaswamy
  • Anthony Rentsch

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hotAD-0.0.1.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hotAD-0.0.1-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file hotAD-0.0.1.tar.gz.

File metadata

  • Download URL: hotAD-0.0.1.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for hotAD-0.0.1.tar.gz
Algorithm Hash digest
SHA256 168b81c940f5a910d4326dfc321513d52dd2ab00f9975fa9a14c8c676e1f6ff6
MD5 0e84810f44e62e71a8bf332a6cade0db
BLAKE2b-256 748136f68287d37a0d80e182e098580dee75dd358d6ccdbf8b58d63130407002

See more details on using hashes here.

File details

Details for the file hotAD-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: hotAD-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.7.0

File hashes

Hashes for hotAD-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a8575627d7bc3bc7698495749ce21bd30f770b38e99f3413c1962b8b364ded6f
MD5 de54d3f406b7ef186e7d9841c1055538
BLAKE2b-256 36be9151484db55b81f1cdec9d324bdcce476e11c232e32401f1c8369593cb33

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page