srtree-2.0.0.0: A general library to work with Symbolic Regression expression trees.
Copyright(c) Fabricio Olivetti 2021 - 2024
LicenseBSD3
Maintainerfabricio.olivetti@gmail.com
Stabilityexperimental
PortabilityFlexibleInstances, DeriveFunctor, ScopedTypeVariables
Safe HaskellSafe-Inferred
LanguageHaskell2010

Algorithm.SRTree.AD

Description

Automatic Differentiation for Expression trees

Synopsis

Documentation

forwardMode :: Array S Ix2 Double -> Array S Ix1 Double -> SRVector -> Fix SRTree -> (Array D Ix1 Double, Array S Ix1 Double) #

Calculates the results of the error vector multiplied by the Jacobian of an expression using forward mode provided a vector of variable values xss, a vector of parameter values theta and a function that changes a Double value to the type of the variable values. uses unsafe operations to use mutable array instead of a tape

forwardModeUnique :: SRMatrix -> PVector -> SRVector -> Fix SRTree -> (SRVector, Array S Ix1 Double) #

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.

reverseModeUnique :: SRMatrix -> PVector -> SRVector -> (SRVector -> SRVector) -> Fix SRTree -> (Array D Ix1 Double, Array S Ix1 Double) #

Same as above, but using reverse mode, that is even faster.

forwardModeUniqueJac :: SRMatrix -> PVector -> Fix SRTree -> [PVector] #

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.