Skip to content
 
 

Repository files navigation

micrograd

This is a personal learning project whose purpose is to reimplement core deep learning principles in numpy and build intuition about them. It is heavily inspired by and built on top of Andrej Karpathy's micrograd project. It currently implements a working MLP trainable on classification tasks using the Adam optimizer.

Classifying scikit-learn's moons with a MLP

MLP

Finding the index of the maximum element in a sequence

Attn

Forked from https://github.com/karpathy/micrograd.

Installation

uv sync --all-extras

Examples

The repo contains several examples that you can run with the folloiwng commands:

python examples/toy_classification.py --dataset moons

Moons

and

python examples/toy_classification.py --dataset circles

Circles

python examples/attention/maximum_classification.py

MaxClassif

python examples/attention/maximum_regression.py

MaxReg

Visualisation

The visualisation module lets you see everything happening in the network during training, including the forward and backward passes.

You can:

  • play/pause with the space bar
  • increase/decrease speed with the up/down arrows
  • step forward/backward with the left/right arrows
  • zoom in/out with the mouse wheel

Caution

The visualisation module is a vibe-coded mess, don't expect it to be polished.

License

MIT

About

A tiny autograd engine and a neural net library on top of it with PyTorch-like API

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages