hobbitgrad
hobbitgrad is a tiny educational autograd library written in pure Python. It includes a small NDArray, a Tensor type with backpropagation, a linear layer, SGD, and mean squared error loss.
Install
pip install hobbitgrad
Example
from hobbitgrad import Linear, SGD, Tensor, mse
x = Tensor([[0, 0], [0, 1], [1, 0], [1, 1]])
y = Tensor([[0], [0], [0], [1]])
model = Linear(2, 1)
optimizer = SGD(model.parameters(), lr=0.1)
for _ in range(100):
pred = model.forward(x)
loss = mse(pred, y)
loss.backward()
optimizer.step()
optimizer.zero_grad()
print(loss.data.data[0])
Current Scope
hobbitgrad currently supports a small set of tensor operations, broadcasting, matrix multiplication, scalar reductions, a linear layer, SGD, and MSE loss.
Release files for hobbitgrad 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| hobbitgrad-0.0.2.tar.gz | 5.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hobbitgrad-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 11.7 kB
Release files / hobbitgrad-0.0.2.tar.gz
| Download URL | hobbitgrad-0.0.2.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fd966a4c12519080362f0b163406951f5025acb7d1028bc38b41d85ad454f41e
|
|
BLAKE2b-256 checksum How to use checksums |
f5ffd7acc50ce3df6d4d7ff975cb5b180d85fb7ab4c2fa431671f4159c50e3cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency logRelease files / hobbitgrad-0.0.2-py3-none-any.whl
| Download URL | hobbitgrad-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
480650b49aeffefc39767164e1dff8ba1b3bf75b80a536bcbf21a633d5b5f1d7
|
|
BLAKE2b-256 checksum How to use checksums |
982bc96efc5265b11d13012a69d797a4dfa0f8b6d9a867edd12966659e265369
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 25, 2026.
Transparency log