Crate rust_ad[−][src]
Expand description
A restrictive WIP beginnings of a library attempting to implement auto-differentiation in Rust.
Status
- Forward Auto-differentiation
- Reverse Auto-differentiation
-
f32
&f64
support* - limited° ndarray support*
- limited° nalgebra support*
-
if
,if else
andelse
support -
for
,while
andloop
support
*typeof
(e.g. decltype
) not being currently implemented in Rust makes support more difficult.
°Support limited to the basic blas-like operations.
Type support
- Primitive support:
+
,-
,*
and/
operations are supported. - Extended support: All operations from std::ops are supported.
- Near-full support: Almost* all native operations (operations implemented by the library which defines the type) are supported.
Please note these just specify a minimum set of operations, full details of other specific supported operations are given below.
*The ‘almost’ exception is here since some operations may simply not be worth supporting given extremely limited usage, possible deprecation, etc.
Primitive support | f32 ,f64 ,i8 ,i16 ,i32 ,i64 ,i128 ,u8 ,u16 ,u32 ,u64 ,u128 |
Extended support | |
Near-full support |
Specific operation support
Notes on internals
With cargo expand
when an .unwrap()
panics it doesn’t give a line reference. Using unique panic messages makes locating errors easier. These should help debuging quite specifically (ctrl+f).
Resources
Macros
Returns a tuple of a given number of clones of a variable.
Calls forward auto-differentiation function corresponding to a given function.
Calls reverse auto-differentiation function corresponding to a given function.
Attribute Macros
Generates the forward auto-differentiation function for a given function.
Generates the reverse auto-differentiation function for a given function.
Flattens nested binary expressions into separate variable assignments.