A lightweight PyTorch-inspired autograd library built from scratch
Project description
SimpleGrade
SimpleGrade is a lightweight Python library inspired by PyTorch and Tinygrad. It provides automatic differentiation and the core components required to build and train neural networks from scratch, making it an educational framework for understanding how deep learning libraries work internally.
Installation
Install the latest release from PyPI:
pip install simplegrade
Or install the latest development version from GitHub:
git clone https://github.com/mohamedrxo/simplegrad.git
cd simplegrad
pip install -e .
Features
- Automatic differentiation (Autograd)
- Tensor operations
- Neural network building blocks
- Linear layers
- Loss functions
- SGD optimizer
- DataLoader
- NumPy-based implementation
- Lightweight and easy to understand
Example
from simplegrade import Tensor
a = Tensor([[1, 2, 3]], requires_grad=True)
b = Tensor([[2, 1, 0]], requires_grad=True)
c = a + b
d = a * b
loss = d.sum()
loss.backward()
print("Loss:", loss)
print("Gradient of a:", a.grad)
print("Gradient of b:", b.grad)
Project Links
- PyPI: https://pypi.org/project/simplegrade/
- GitHub: https://github.com/mohamedrxo/simplegrad
- Issues: https://github.com/mohamedrxo/simplegrad/issues
Contributing
Contributions, bug reports, feature requests, and suggestions are welcome. If you find this project useful, consider starring the repository on GitHub.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simplegrade-0.1.5.tar.gz.
File metadata
- Download URL: simplegrade-0.1.5.tar.gz
- Upload date:
- Size: 8.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59e5be6849db25b132f8e3c94308c1e6d79695521aea5ce8cad12fb9a377d821
|
|
| MD5 |
a1239a133e385d78717fe7c769f60857
|
|
| BLAKE2b-256 |
36867b2fbd0a067d9c0cda7e0022417b82cee2d8c4d07338ceeafa083264a204
|
File details
Details for the file simplegrade-0.1.5-py3-none-any.whl.
File metadata
- Download URL: simplegrade-0.1.5-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74917c679289f33776d8895c4c372a4e230e34c3abc965277b0bc2b5a2dc59a7
|
|
| MD5 |
5e316aa24da001845632c2aae1b8b69d
|
|
| BLAKE2b-256 |
1ad1b10ce505114ae8bd7de33afaa0bb08f667edf2dee4ef731aa0f33206347f
|