Why LeanPass?
- Minimal dependency footprint: only NumPy
- Readable, transparent implementation
- Core autodiff and model-building primitives
- Great for education, prototyping, and learning
Features
- Tensor objects with reverse-mode autodiff
- Arithmetic operators, matrix multiplication, and broadcasting
- Activation functions: relu, sigmoid, softmax
- Neural network layers: Linear and MLP
- Optimizers: SGD and Adam
- Simple demo script and test coverage
Install
pip install leanpass
Quick start
from leanpass import Tensor, nn
x = Tensor([[1.0, 2.0]], requires_grad=False)
model = nn.MLP([2, 16, 3])
logits = model(x)
print(logits)
Run the demo
python demo.py
Repository layout
- leanpass/ — package source code
- tests/ — regression and gradient-check tests
- demo.py — end-to-end example
- pyproject.toml — package metadata
Contribution
See the repository files for guidelines: