aad - Automatic Adjoint Differentiation Library
A pure Rust automatic differentiation library using reverse-mode adjoint differentiation.
Features
- Supports both f32 and f64: Generic implementation works with any floating-point type implementing
num_traits::Float. - Reverse-mode autodiff: Efficiently compute gradients for scalar-valued functions with many inputs.
- Operator overloading: Use standard mathematical operators with variables.
- High Performance: Optimized for minimal runtime overhead.
- Benchmarks show competitive performance, often outperforming alternatives in gradient computation ( see Benchmarks).
- Type-agnostic functions: Write generic mathematical code using the
ScalarLiketrait.
Installation
Add to your Cargo.toml:
[]
= "0.5.0"
For benchmarks:
[]
= ["aad/benchmarks"]
Usage
Basic Example
use ;
Generic Mathematical Functions
use ;
Benchmarks
Run benchmarks with:
License
MIT License - see LICENSE file