Higher Order Reverse Derivatives Efficiently - Automatic Differentiation library based on the paper "Provably correct, asymptotically efficient, higher-order reverse-mode automatic differentiation"
BSD 3-Clause "New" or "Revised" License
34
stars
6
forks
source link
Merge rev and srev functions without requiring the user to write more type application #92
via type classes and failed. This may or may not be possible for deep or shallow reasons. My hunch is that it's not a GHC limitation, but either my brain's limitation or unavoidable ambiguity.
Function rev computes a gradient, assuming a tensor codomain, while srev assumes scalar (Double or Float) codomain.
I tried that on branch
https://github.com/Mikolaj/horde-ad/tree/failed-rev-scalar-codomain
via type classes and failed. This may or may not be possible for deep or shallow reasons. My hunch is that it's not a GHC limitation, but either my brain's limitation or unavoidable ambiguity.
Function
rev
computes a gradient, assuming a tensor codomain, whilesrev
assumes scalar (Double or Float) codomain.