whatgrad

Crates.iowhatgrad
lib.rswhatgrad
version0.1.0
sourcesrc
created_at2023-01-23 18:07:56.03976
updated_at2023-01-23 18:07:56.03976
descriptionErgonomic reverse mode autodifferentiation
homepagehttps://github.com/lewis-carson/whatgrad
repositoryhttps://github.com/lewis-carson/whatgard
max_upload_size
id766055
size7,351
Lewis Carson (lewis-carson)

documentation

https://github.com/lewis-carson/whatgrad

README

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));
}

Commit count: 0

cargo fmt