Crates.io | whatgrad |
lib.rs | whatgrad |
version | 0.1.0 |
source | src |
created_at | 2023-01-23 18:07:56.03976 |
updated_at | 2023-01-23 18:07:56.03976 |
description | Ergonomic reverse mode autodifferentiation |
homepage | https://github.com/lewis-carson/whatgrad |
repository | https://github.com/lewis-carson/whatgard |
max_upload_size | |
id | 766055 |
size | 7,351 |
whatgrad
is a crate for computing the gradient of a function with respect to its arguments. Full writeup here.
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));
}