| Copyright | (C) 2023 Alexey Tochin |
|---|---|
| License | BSD3 (see the file LICENSE) |
| Maintainer | Alexey Tochin <Alexey.Tochin@gmail.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
Debug.DiffExpr
Description
Tools for symbolic differentiation expressions.
Synopsis
- twoArgFunc :: String -> SimpleExpr -> SimpleExpr -> SimpleExpr
- class SymbolicFunc a where
- unarySymbolicFunc :: String -> a -> a
- class BinarySymbolicFunc a where
- binarySymbolicFunc :: String -> a -> a -> a
- type TracedSimpleExpr = Traced SimpleExpr
- type TSE = TracedSimpleExpr
Documentation
twoArgFunc :: String -> SimpleExpr -> SimpleExpr -> SimpleExpr Source #
Create a binary function expression.
Examples
>>>import Debug.SimpleExpr (variable)
>>>twoArgFunc "f" (variable "x") (variable "y")f(x,y)
class SymbolicFunc a where Source #
This typecalss is for creating symbolic unary function expressions.
It is used in conjunction with automatic differentiation to represent functions symbolically.
Examples
>>>import Debug.SimpleExpr (variable)>>>import Numeric.InfBackprop (simpleDerivative)
>>>:{f :: SymbolicFunc a => a -> a f = unarySymbolicFunc "f" :}
>>>f (variable "x")f(x)
>>>simpleDerivative f (variable "x")f'(x)*1
Methods
unarySymbolicFunc :: String -> a -> a Source #
Instances
| SymbolicFunc SimpleExpr Source # |
|
Defined in Debug.DiffExpr Methods unarySymbolicFunc :: String -> SimpleExpr -> SimpleExpr Source # | |
| (SymbolicFunc a, Show a) => SymbolicFunc (Traced a) Source # |
|
Defined in Debug.DiffExpr Methods unarySymbolicFunc :: String -> Traced a -> Traced a Source # | |
| (SymbolicFunc a, Multiplicative a) => SymbolicFunc (RevDiff t a a) Source # |
|
Defined in Debug.DiffExpr | |
class BinarySymbolicFunc a where Source #
This typecalss is for creating symbolic binary function expressions.
It is used in conjunction with automatic differentiation to represent
functions symbolically. See SymbolicFunc for unary functions.
Methods
binarySymbolicFunc :: String -> a -> a -> a Source #
Instances
| BinarySymbolicFunc SimpleExpr Source # |
|
Defined in Debug.DiffExpr Methods binarySymbolicFunc :: String -> SimpleExpr -> SimpleExpr -> SimpleExpr Source # | |
| (BinarySymbolicFunc a, Show a) => BinarySymbolicFunc (Traced a) Source # |
|
Defined in Debug.DiffExpr Methods binarySymbolicFunc :: String -> Traced a -> Traced a -> Traced a Source # | |
| (BinarySymbolicFunc a, Distributive a, Additive t) => BinarySymbolicFunc (RevDiff t a a) Source # |
|
Defined in Debug.DiffExpr | |
type TracedSimpleExpr = Traced SimpleExpr Source #
A traced version of SimpleExpr for debugging purposes.
type TSE = TracedSimpleExpr Source #
A type alias for Traced version of SimpleExpr.