frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Micrograd a 24kb pure Python autodiff lib

https://github.com/brief-ds/micrograd
2•aglassofred•7mo ago

Comments

aglassofred•7mo ago
A tiny Autograd engine whose only dependency is NumPy. Implements backpropagation (reverse-mode autodiff) over a dynamically built DAG and a small neural networks library on top of it with a PyTorch-like API. Both are tiny.

- 24 kilobytes code without tests - as portable as Python and NumPy - loads 10x faster than PyTorch, 30x faster than TensorFlow

This version is capable of working with matrices and higher-order tensors. For @karpathy's original scalar-based version, locate the code with tag scalar.