Skip to main content

A lightweight PyTorch-inspired autograd library built from scratch

Project description

# SimpleGrade

[![PyPI version](https://img.shields.io/pypi/v/simplegrade)](https://pypi.org/project/simplegrade/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/simplegrade)](https://pypi.org/project/simplegrade/)
[![GitHub stars](https://img.shields.io/github/stars/mohamedrxo/simplegrad?style=social)](https://github.com/mohamedrxo/simplegrad)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

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:

```bash
pip install simplegrade
```

Or install the latest development version from GitHub:

```bash
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

```python
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

simplegrade-0.1.4.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplegrade-0.1.4-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file simplegrade-0.1.4.tar.gz.

File metadata

  • Download URL: simplegrade-0.1.4.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

Hashes for simplegrade-0.1.4.tar.gz
Algorithm Hash digest
SHA256 ae4e9957e859bbea9d423de2ee423734b1b0841032aecf2c7a5f8ead7cdcf15f
MD5 90af590fae64ac503635f03bb8b92b52
BLAKE2b-256 05fb4a7293352f69a98e84804e964ad3d4f670840de384f53f51839a923c7d90

See more details on using hashes here.

File details

Details for the file simplegrade-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: simplegrade-0.1.4-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

Hashes for simplegrade-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6fee553ab20be665898c7762c58274ffd983d66dcb77ff20432a72f7dd6cb334
MD5 d6a2eef4c4af795928e740e70a3ede76
BLAKE2b-256 ce980522ddd9d01ca9518d5df7fddd658608d4a375438a97fd22b336798c608c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page