| Copyright | (c) Fabricio Olivetti 2021 - 2024 |
|---|---|
| License | BSD3 |
| Maintainer | [email protected] |
| Stability | experimental |
| Portability | FlexibleInstances, DeriveFunctor, ScopedTypeVariables |
| Safe Haskell | None |
| Language | Haskell2010 |
Algorithm.SRTree.AD
Description
Automatic Differentiation for Expression trees
Synopsis
- reverseModeArr :: SRMatrix -> PVector -> Maybe PVector -> Vector Double -> [(Int, (Int, Int, Int, Double))] -> IntMap Int -> (Array D Ix1 Double, Array S Ix1 Double)
- reverseModeGraph :: SRMatrix -> PVector -> Maybe PVector -> Vector Double -> Fix SRTree -> (Array D Ix1 Double, Vector Double)
- forwardModeUniqueJac :: SRMatrix -> PVector -> Fix SRTree -> [PVector]
Documentation
reverseModeArr :: SRMatrix -> PVector -> Maybe PVector -> Vector Double -> [(Int, (Int, Int, Int, Double))] -> IntMap Int -> (Array D Ix1 Double, Array S Ix1 Double) Source #
Same as above, but using reverse mode with the tree encoded as an array, that is even faster.
reverseModeGraph :: SRMatrix -> PVector -> Maybe PVector -> Vector Double -> Fix SRTree -> (Array D Ix1 Double, Vector Double) Source #
forwardModeUniqueJac :: SRMatrix -> PVector -> Fix SRTree -> [PVector] Source #
The function forwardModeUnique calculates the numerical gradient of the tree and evaluates the tree at the same time. It assumes that each parameter has a unique occurrence in the expression. This should be significantly faster than forwardMode.