Prev Next Index-> contents reference index search external Up-> pycppad

$\newcommand{\B}[1]{{\bf #1}}$$\newcommand{\R}[1]{{\rm #1}}$
pycppad-20140710: A Python Algorithm Derivative Package

Syntax
Purpose
Simple Example
Features
Contents
 Manual split into sections    Manual as one web page Math displayed using Latex    pycppad.htm    _printable.htm Math displayed using MathML    pycppad.xml    _printable.xml

BSD

Syntax
from pycppad import *

Purpose
The command above imports a boost::python interface to the C++ Algorithmic Differentiation (AD) package CppAD .

Simple Example  from pycppad import * def pycppad_test_get_started() : def F(x) : # function to be differentiated return exp(-(x[0]**2. + x[1]**2.) / 2.) # is Gaussian density x = numpy.array( [ 1., 2.] ) a_x = independent(x) a_y = numpy.array( [ F(a_x) ] ) f = adfun(a_x, a_y) J = f.jacobian(x) # J = F'(x) assert abs( J[0, 0] + F(x) * x[0] ) < 1e-10 # J[0,0] ~= - F(x) * x[0] assert abs( J[0, 1] + F(x) * x[1] ) < 1e-10 # J[0,1] ~= - F(x) * x[1] 

Features
Operator overloading is used to store the operation sequence corresponding to a python algorithm. The operation sequence can be evaluated to obtain new function values or derivatives of arbitrary order. In addition, multiple levels of AD are supported. This means that AD derivatives can be used in the definition of a function which in turn can be differentiated using AD. See whats_new for a list of recent extensions and bug fixes.

Contents
 _contents Table of Contents install Installing pycppad get_started.py get_started: Example and Test example List of All the pycppad Examples ad_variable AD Variable Methods ad_function AD Function Methods two_levels.py Using Two Levels of AD: Example and Test runge_kutta_4 Fourth Order Runge Kutta whats_new Extensions, Bug Fixes, and Changes license License _reference Alphabetic Listing of Cross Reference Tags _index Keyword Index _search Search Python Algorithmic Differentiation Using CppAD _external External Internet References

Input File: doc.omh