Skip to content

A tiny autograd engine for learning purposes in Rust

Notifications You must be signed in to change notification settings

noahpro99/micrograd-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

micrograd.rs

A tiny autograd engine for learning purposes in Rust. Based on the Python version micrograd.

Sample Trained Model

Another Sample Trained Model

Loss vs Epochs

Example usage

let v1 = Value::from(2.0);
let v2 = Value::from(3.0);
let v3 = &v1 + &v2;
let v4 = &v3 * &v1;
let v5 = &v4.pow(2);
v5.back_prop();

assert_eq!(v5.value(), 100.0);
assert_eq!(v1.grad(), 140.0);
assert_eq!(v2.grad(), 40.0);

TODO ✨

  • Create Value struct with computational graph
  • Test on some test data
  • Implement graphing of computational graph

This project is in no way endorsed by the Rust Foundation.

About

A tiny autograd engine for learning purposes in Rust

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages