Skip to content

Latest commit

 

History

42 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microjax: JAX in two classes and six functions

JAX-style automatic-differentiation system from first principles in fewer than 500 lines of Python. It covers computation tracing, NumPy-like primitives, vector-Jacobian products, reverse-mode autodiff, and higher-order differentiation, with a small neural-network library demonstrating end-to-end training.

Open In Colab or Read on Github (I recommend actually running the notebook, either on your own computer or Colab).

This is inspired by Andrej Karpathy's Micrograd, a PyTorch-like library in about 150 lines of code. Despite PyTorch's popularity, I prefer the way JAX works because it a more functional style.

This tutorial borrows heavily from Matthew J Johnson's great 2017 presentation on the predecessor to JAX, autograd: Video / Slides / Code. My main contribution is simplifying a bit and packaging it as a notebook.

About

A tiny autograd engine with a Jax-like API

Resources

Stars

75 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages