whatgrad 0.1.0

Ergonomic reverse mode autodifferentiation
Documentation
  • Coverage
  • 0%
    0 out of 8 items documented0 out of 0 items with examples
  • Size
  • Source code size: 6.87 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.89 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 16s Average build duration of successful builds.
  • all releases: 16s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lewis-carson

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