Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emlgrad

emlgrad is a tiny scalar autograd toy with strong micrograd vibes.

The twist is that it only has one primitive math op:

eml(x, y) = exp(x) - ln(y)

This project is mostly inspired by:

So the basic idea is:

What if a micrograd-style engine kept the same small DAG + backprop feel, but built its math by composing EML?

What's here

Higher ops like log, +, -, *, /, **, and relu are all lowered into eml.

Notes

  • complex-domain first
  • principal-branch log
  • branch cuts and log(0) are not hidden away
  • some paths can still produce inf or nan

This repo is meant to stay small, readable, and a little weird.

Quickstart

This repo uses uv.

uv sync --group dev
uv run python -m unittest discover -s tests
uv run --group dev ruff check .

To open the notebook:

uv run --with jupyter jupyter notebook demo.ipynb

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages