Metadata-Version: 2.4
Name: knoxtinytorch
Version: 0.1.1
Summary: A tiny PyTorch-like neural network library built from scratch using NumPy
Author: Knox
Project-URL: Homepage, https://github.com/KnoxCodes/TinyTorch
Project-URL: Source, https://github.com/KnoxCodes/TinyTorch
Keywords: deep-learning,neural-network,machine-learning,numpy,pytorch-like
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Dynamic: license-file

# TinyTorch

A tiny **PyTorch-like neural network library built from scratch using NumPy**.

This project was created to understand how deep learning frameworks like PyTorch work internally.

---

## Features

* Linear layers
* Activation functions (ReLU, Sigmoid, Tanh, LeakyReLU, ELU, PReLU)
* Loss functions
* Optimizers (SGD, Momentum, RMSProp, Adam)
* Batch Normalization
* Dropout
* Sequential model API
* Automatic parameter detection

---

## Installation

```bash
pip install knoxtinytorch
```

---

## Quick Example

```python
import numpy as np
from tinytorch import Sequential, Linear, ReLU
from tinytorch import MeanSquaredError, Adam

X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])

model = Sequential(
    Linear(2,8),
    ReLU(),
    Linear(8,1)
)

loss_fn = MeanSquaredError()
optimizer = Adam(model.parameters(), lr=0.05)

for epoch in range(5000):

    y_pred = model(X)

    loss = loss_fn.forward(y_pred, y)

    grad = loss_fn.backward()

    model.backward(grad)

    optimizer.step()
    model.zero_grad()
```

---

## Example Project

Train a neural network to learn the **XOR problem**.

See:

```
examples/xor_example.py
```

---

## Project Motivation

Most deep learning users rely on frameworks like PyTorch or TensorFlow without understanding how they work internally.

This project recreates the **core components of a deep learning framework from scratch** using only NumPy.

---

## GitHub

https://github.com/KnoxCodes/TinyTorch
