I like the unified interface for differentiation. My only qualm is with flattening out the hierarchy of packages by including DualNumbers. There was some discussion on this here: https://github.com/johnmyleswhite/Calculus.jl/pull/44
To start out, what is the intended scope of Calculus.jl? Once you start getting into including automatic differentiation it opens up a whole can of worms. For example, why swallow up DualNumbers and not PowerSeries? What about reverse mode for gradients and Hessians? There are too many different approaches, and I don't think they all belong under one package. We're using DualNumbers now because it's stable and mostly just works, but we should be leaving room for future developments. Proposal: 1. Low-level package (SymbolicDerivatives.jl?) that exports a table of symbolic derivatives that can be shared among different implementations. gradexpr and hessexpr can go here too. 2. Differentiation packages: DualNumbers, PowerSeries, ReverseDiffOverload, ReverseDiffSparse, ReverseDiffSource, etc. 3. Unified interface like the one implemented in Calculus2 with grad/hess. (Call this Derivatives.jl?) On Sunday, March 23, 2014 1:28:03 PM UTC-4, John Myles White wrote: > > I recently had a project where I made heavy use of the Calculus package > and found that the interface has really fallen out of sync with the > functionality that’s available. I also found myself wanting to have easier > access to forward-mode automatic differentation. > > So I wrote up a variant of the Calculus package, which I’m calling > Calculus2, to provide a demonstration of a new interface that I’d like to > propose for the Calculus package. You can try the new interface here: > > https://github.com/johnmyleswhite/Calculus2.jl > > This package takes the old Calculus code and cleans it up, but also fully > incorporates the DualNumbers package, so that you can switch between many > different styles of differentiation using two keyword arguments: > > using Calculus2 > grad(sin, 1.0, method = :finite) > grad(sin, 1.0, method = :finite, direction = :complex) > grad(sin, 1.0, method = :ad) > > hess(sin, 1.0, method = :finite) > > I’d be really interested to see if people think this interface is worth > pursuing. I’m hopeful that this interface or something similar can help to > surface all of the useful functionality that’s been hidden inside of the > Calculus package. > > — John > >