[Numpy-discussion] [ANN] ALGOPY 0.21, algorithmic differentiation in Python

John Salvatier jsalvati@u.washington....
Sun Aug 1 17:16:47 CDT 2010


Holy cow! I was looking for this exact package for extending pymc! Now I've
found two packages that do basically exactly what I want (Theano and
ALGOPY).

Does ALYGOPY handle derivatives of operations on higher order ndimensional
arrays well (efficiently and including broadcasting and such)?

John

On Sun, Aug 1, 2010 at 5:05 AM, Sebastian Walter <sebastian.walter@gmail.com
> wrote:

> I'm happy to announce the first official release of ALGOPY in version
> 0.2.1.
>
> Rationale:
> ~~~~~~~~
> The purpose of ALGOPY is the evaluation of higher-order derivatives in
> the forward and reverse mode of Algorithmic Differentiation (AD) using
> univariate Taylor polynomial arithmetic. Particular focus are
> functions that contain numerical linear algebra functions (e.g. inv,
> dot, eigh, qr, cholesky,...) as they often appear in statistically
> motivated functions.
>
> Download:
> ~~~~~~~~~
> http://pypi.python.org/pypi/algopy/0.2.1
> or bleeding edge versions from from http://github.com/b45ch1/algopy
>
> Documentation:
> ~~~~~~~~~~~~
> available at http://packages.python.org/algopy/
>
> OS Support:
> ~~~~~~~~~~
> Linux, Windows (tested with pythonxy), should also work on Mac
>
> Software Dependencies:
> ~~~~~~~~~~~~~~~~~~~~
> for the core: numpy, scipy
> for testing:  nose
>
> Exampe Session:
> ~~~~~~~~~~~~~
> Consider the contrived example where it is the goal to compute the
> directional derivative df/dx_1 :
>
> >>> import numpy; from numpy import log, exp, sin, cos
> >>> import algopy; from algopy import UTPM, dot, inv, zeros
> >>>
> >>> def f(x):
> ...     A = zeros((2,2),dtype=x)
> ...     A[0,0] = numpy.log(x[0]*x[1])
> ...     A[0,1] = numpy.log(x[1]) + exp(x[0])
> ...     A[1,0] = sin(x[1])**2 + cos(x[0])**3.1
> ...     A[1,1] = x[0]**cos(x[1])
> ...     return log( dot(x.T,  dot( inv(A), x)))
> ...
> >>>
> >>> x = UTPM(zeros((2,1,2),dtype=float))
> >>> x.data[0,0] = [1,2]
> >>> x.data[1,0] = [1,0]
> >>> y = f(x)
> >>>
> >>> print 'normal function evaluation f(x) = ',y.data[0,0]
> normal function evaluation f(x) =  0.641250189986
> >>> print 'directional derivative df/dx1 = ',y.data[1,0]
> directional derivative df/dx1 =  1.62982340133
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100801/77b1cd67/attachment.html 


More information about the NumPy-Discussion mailing list