Skip to content

lewis-carson/whatgrad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ergonomic reverse mode autodifferentiation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages