autograd
A library to run the computation graphs whose backend is rust-ndarray.
Documentation: https://docs.rs/autograd/
Overview
- Automatic differentiation
- Pure Rust
- Neural net first APIs
- Dynamic/static graph construction with shared variables
Example
Here we are computing partial derivatives of z = 2x^2 + 3y + 1
.
extern crate ndarray;
extern crate autograd as ag;
let ref x = placeholder;
let ref y = variable;
let ref z = 2*x*x + 3*y + 1;
// dz/dy
let ref g1 = gradients;
// dz/dx
let ref g2 = gradients;
// ddz/dx (differentiates `z` again)
let ref gg = gradients;
// evaluation of symbolic gradients
assert_eq!;
assert_eq!;
// dz/dx requires to fill the placeholder `x`
let feed = new.add;
assert_eq!;
For more, see examples or tests.
License
MIT