1 unstable release

0.1.0 Jan 23, 2023

#14 in #differentiation

MIT license

7KB
158 lines

whatgrad

whatgrad is a crate for computing the gradient of a function with respect to its arguments. Full writeup here.

Usage


use whatgrad::Scope;

fn main() {
    let scope = Scope::new();
    let x = scope.value(7.0);
    let y = scope.value(11.0);

    let z = x * y;
    let grad = z.backwards();

    println!("dz/dx = {}", grad.wrt(x));
    println!("dz/dy = {}", grad.wrt(y));
}

Dependencies

~155KB