# Neograd

A from-scratch deep-learning framework in Python and NumPy, on PyPI, with gradient checking, a PyTorch-like API and documentation on Read the Docs.

- Web page: https://pranavsastry.com/projects/neograd
- Kind: Project
- Headline: I wrote a deep-learning framework to understand **autograd**.
- Stack: Python, NumPy
- Status: On PyPI
- Year: 2022

## What it does

Automatic differentiation for scalars, vectors and matrices with NumPy broadcasting, custom operations defined by a forward and a backward method, and gradient checking to confirm that gradients flow correctly.

**Figure 1. Forward, then backward.** Automatic differentiation in Neograd, on a two-input graph.

What the animated figure shows: The forward pass runs x and W through matmul and relu to the loss; the backward pass walks the same graph in reverse and gives every node its gradient.

## What sits on top

A PyTorch-like API with layers, activations, losses and optimizers such as Adam, and saving, loading and checkpoints during training.

## How it ships

Tests run in CI, the documentation is on Read the Docs, and the package is on PyPI. It is meant for learning, not as a replacement for PyTorch.

## Links

- GitHub: [https://github.com/pranftw/neograd](https://github.com/pranftw/neograd)
- PyPI: [https://pypi.org/project/neograd/](https://pypi.org/project/neograd/)
- Documentation: [https://neograd.readthedocs.io/](https://neograd.readthedocs.io/)

## More projects

- [AutoPilot](https://pranavsastry.com/projects/autopilot.md) optimizes prompts, rules and agents the way PyTorch trains a model, and **rolls back** a change that does not hold up.
- [Aiter](https://pranavsastry.com/projects/aiter.md) is a terminal AI agent I wrote so I could change its **tools**, MCP servers and saved sessions.
- [RecLLM](https://pranavsastry.com/projects/recllm.md) is a prototype for **shopping by conversation**: an index of a store’s catalog, and a memory of what each shopper likes.
- [OpenReview Scraper](https://pranavsastry.com/projects/openreview-scraper.md) turns conference submissions into a **reading list** by searching their titles, abstracts and keywords.
- [ODDGen](https://pranavsastry.com/projects/oddgen.md) builds object-detection datasets from cut-out objects, with **the bounding boxes written for you**.
- [rapidx](https://pranavsastry.com/projects/rapidx.md) runs experiments from many research codebases through one entry point, each in its **own environment**.
- [All projects](https://pranavsastry.com/projects.md)
- [Home and directory](https://pranavsastry.com/index.md)
