Forward-mode automatic differentiation over Luna Flow algebraic and arithmetic structures.
Dependencies
moon add Luna-Flow/autodiff@0.3.1// moon.pkg
import {
"Luna-Flow/autodiff",
}fn main {
let (value, slope) = @autodiff.value_and_diff(x => x * x + x.sin(), 2.0)
println("f(2) = \{value}, f'(2) = \{slope}")
}f(2) = 4.909297426825682, f'(2) = 3.5838531634528574| Package | Purpose |
|---|---|
| Luna-Flow/autodiff | facade: Dual, diff, value_and_diff, re-exported traits and error types |
| Luna-Flow/autodiff/dual | Dual[T]: arithmetic, derivative rules, checked division and square root, trait instances |
| Luna-Flow/autodiff/forward | scalar drivers diff and value_and_diff |
| Luna-Flow/autodiff/core | algebraic facade (Dual and luna-generic structure traits) |
| Luna-Flow/autodiff/elementary | analytic facade (Sqrt, Exponential, Logarithmic, Trigonometric, Constants) |
| Luna-Flow/autodiff/checked | checked facade (DivChecked, SqrtChecked, ArithmeticContext, ArithmeticError) |
| Luna-Flow/autodiff/linalg | gradient, jacobian and their value_and_* forms over linear-algebra/immut |
| Luna-Flow/autodiff/poly | derivatives of dense and univariate sparse luna-poly polynomials |
Install
Download zipForward-mode automatic differentiation over Luna Flow algebraic and arithmetic structures.
Dependencies