Portability | GHC only |
---|---|

Stability | experimental |

Maintainer | ekmett@gmail.com |

Safe Haskell | None |

Dense Forward AD. Useful when the result involves the majority of the input
elements. Do not use for `hessian`

and beyond, since
they only contain a small number of unique `n`

th derivatives --
`(n + k - 1) `

for functions of `choose`

k`k`

inputs rather than the
`k^n`

that would be generated by using `Dense`

, not to mention the redundant
intermediate derivatives that would be
calculated over and over during that process!

Assumes all instances of `f`

have the same number of elements.

NB: We don't need the full power of `Traversable`

here, we could get
by with a notion of zippable that can plug in 0's for the missing
entries. This might allow for gradients where `f`

has exponentials like `((->) a)`

# Documentation

(Traversable f, Num a, Bounded a) => Bounded (Dense f a s) | |

(Traversable f, Num a, Enum a) => Enum (Dense f a s) | |

(Traversable f, Num a, Eq a) => Eq (Dense f a s) | |

(Traversable f, Floating a) => Floating (Dense f a s) | |

(Traversable f, Fractional a) => Fractional (Dense f a s) | |

(Traversable f, Num a) => Num (Dense f a s) | |

(Traversable f, Num a, Ord a) => Ord (Dense f a s) | |

(Traversable f, Real a) => Real (Dense f a s) | |

(Traversable f, RealFloat a) => RealFloat (Dense f a s) | |

(Traversable f, RealFrac a) => RealFrac (Dense f a s) | |

Show a => Show (Dense f a s) | |

(Traversable f, Erf a) => Erf (Dense f a s) | |

(Traversable f, InvErf a) => InvErf (Dense f a s) | |

(Num a, Traversable f) => Mode (Dense f a s) | |

(Traversable f, Num a) => Jacobian (Dense f a s) |

vars :: (Traversable f, Num a) => f a -> f (Dense f a s)Source

apply :: (Traversable f, Num a) => (f (Dense f a s) -> b) -> f a -> bSource