bob-carpenter / ad-handbook

Automatic Differentiation Handbook
Other
144 stars 18 forks source link

Small issue in the intro #1

Closed spinkney closed 4 years ago

spinkney commented 4 years ago

Saw your post on discourse and was checking this out. I noticed in the index.Rmd you write:

Automatic differentiation is a general technique for lifting a function computing values to one that also computes derivatives.

Two small issues that impact the understanding. 1) Could you explain or use different terminology for what "lifting" means (I found some references to lifting a function below) and 2) I see the dependent clause after 'function' was used to loosely define this, maybe just expand into a new sentence such as

Automatic differentiation is a general technique for lifting a function from computing values to also computing derivatives.

bob-carpenter commented 4 years ago

Thanks for commenting. "Lift" just means mapping a function to another function with a richer type. There are lots of specific cases. For example, I could lift a function that maps characters to characters to one that maps strings to strings.

This page on lifting in Haskell and this Stackoverflow description on Haskell explain the general concept and have several examples, but it's Haskell, so there's still a lot of jargon.

In the simplest case, autodiff converts a function f: Reals -> Reals to a function g: Reals -> (Reals x Reals) by setting g(x) = (f(x), f'(x)). That is, g(x) returns a pair consiting of the value f(x) and the derivative f'(x).

In our case, it's not like there's a generic higher-order function to do the lifting the way there is in the usual examples. So I'll just drop the confusing language.