Skip to content

Latest commit

 

History

History
20 lines (18 loc) · 1.31 KB

README.md

File metadata and controls

20 lines (18 loc) · 1.31 KB

🔥Micrograd 🔥

Attempting to follow Andrej Karpathy's wonderful tutorial and implement micrograd in mojo.

Notes

  • The Value uses reference semantics.
  • The Value's internal data, grad and _prev use a custom and very basic RC (reference counting pointer) - this will be migrated to references (and lifetimes) once they are ready in the core language.
  • Using traits to make Value a generic struct (we introduce a trait called Gradable which is basically a type constraint on what is needed on an 'autogradable' type which can be wrapped by our Value).
  • Gradable implementations:
    • GradFloat32
    • GradTensorFloat32
  • The topological sort in _backward is using an iterative implementation (nested functions don't currently support recursion)
  • Primitive test suite (make test) (including tests that mimic those of micrograd)

Dev setup