matsumotosan / tiny

A tiny autograd engine inspired by micrograd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tinygrad

Reimplementation of micrograd by Andrej Karpathy, and then some. The goal is to create a simple reimplementation of the very basic functionality of PyTorch while remaining as simple as possible.

This serves mainly as way to familiarize myself with the inner workings of PyTorch and experiment with tools for testing, packaging, code coverage, and CI.

Installation

To install tinygrad, run the following command:

pip install tinygrad

Examples

from micrograd.engine import Value

# Initialize variables
a = Value(1.0)

# Forward pass through simple MLP
out = MLP(x)

# Draw computational graph of MLP
draw_graph(out)

Tests

All tests were run using pytest and can be run by running:

pytest

References

micrograd

About

A tiny autograd engine inspired by micrograd


Languages

Language:Python 100.0%