| Crates.io | whatgrad |
| lib.rs | whatgrad |
| version | 0.1.0 |
| created_at | 2023-01-23 18:07:56.03976+00 |
| updated_at | 2023-01-23 18:07:56.03976+00 |
| 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));
}