Tinkerbell is a lightweight, educational deep learning framework built entirely from scratch
Project description
Tinkerbell
Tinkerbell is a lightweight, educational deep learning framework built entirely from scratch using NumPy. It is designed to demonstrate the fundamental building blocks of neural networks, including forward and backward propagation, gradient descent, and modular layer architecture.
Features
- Modular Architecture: Built with
FunctionBlockandLayerabstractions. - Automated Backward Pass: Manual implementation of gradients for all blocks.
- Layers:
DenseLayer: Standard fully connected layer.SigmoidLayer: Sigmoid activation function.
- Optimizers:
SGD: Stochastic Gradient Descent.
- Loss Functions:
MSELoss: Mean Squared Error.
- Additional Tools:
SimpleLinearRegression: A simplified implementation for linear problems.- Progress tracking with
tqdm.
🛠️ Installation
-
Clone the repository:
git clone https://github.com/yourusername/tinkerbell.git cd tinkerbell
-
Install dependencies:
pip install -e .
Quick Start
Building and training a model in Tinkerbell is straightforward:
import numpy as np
from tinkerbell.models import Model
from tinkerbell.layers import DenseLayer, SigmoidLayer
from tinkerbell.loss import MSELoss
from tinkerbell.optimizer import SGD
# 1. Create dummy data
x = np.random.random((100, 3))
y = np.dot(x, np.array([[2.0], [3.0], [4.0]])) + 5.0
# 2. Initialize the Model
model = Model(layers=[
DenseLayer(output_dim=4),
SigmoidLayer(),
DenseLayer(output_dim=1)
])
# 3. Setup Optimizer and Loss
optimizer = SGD(model.get_params(), learning_rate=0.01)
model.trainer(loss=MSELoss(), optimizer=optimizer)
# 4. Fit the Model
model.fit(x, y, epochs=100, batch_size=10)
# 5. Make Predictions
predictions = model(x)
Project Structure
src/
└── tinkerbell/
├── core.py # Base classes for blocks (WeightMatrix, Bias)
├── functions.py # Activation functions (Sigmoid)
├── layers.py # Layer implementations (Dense, Sigmoid)
├── loss.py # Loss functions (MSE)
├── models.py # Model class and training logic
└── optimizer.py # Optimization algorithms (SGD)
Authors
- Aaiswarya Mishra - aaishwarymishra@gmail.com
Project details
Release history Release notifications | RSS feed
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 tinkerbell-0.1.0.tar.gz.
File metadata
- Download URL: tinkerbell-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47709f9586eb2f6d73f6e3c8238782fb3b83c8b044b08a0478e64e7a869ddf5b
|
|
| MD5 |
f08d77147c0bf99caadc2ac01bcfbb78
|
|
| BLAKE2b-256 |
fc5ad00a7b9f8d9eb644e038408c79694b9bc6f2d61571c17f23a6904b0d436c
|
Provenance
The following attestation bundles were made for tinkerbell-0.1.0.tar.gz:
Publisher:
pypi-publish.yml on aaishwarymishra/tinkerbell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tinkerbell-0.1.0.tar.gz -
Subject digest:
47709f9586eb2f6d73f6e3c8238782fb3b83c8b044b08a0478e64e7a869ddf5b - Sigstore transparency entry: 833755607
- Sigstore integration time:
-
Permalink:
aaishwarymishra/tinkerbell@0838f2bbcc7a9e6f0f61559696fee18eefa46998 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aaishwarymishra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@0838f2bbcc7a9e6f0f61559696fee18eefa46998 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tinkerbell-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tinkerbell-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc0fce7991bae7138d25528925c48d3f4d6dfd90080fed2c4fffa1f50d95b2c1
|
|
| MD5 |
43b99521d78aa9ed83c540e5c88f4f7f
|
|
| BLAKE2b-256 |
1d5ee8af76ad92eb15454ad3c3db170c13ae8d5e586dd4bfca32fd6e6c756d89
|
Provenance
The following attestation bundles were made for tinkerbell-0.1.0-py3-none-any.whl:
Publisher:
pypi-publish.yml on aaishwarymishra/tinkerbell
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tinkerbell-0.1.0-py3-none-any.whl -
Subject digest:
bc0fce7991bae7138d25528925c48d3f4d6dfd90080fed2c4fffa1f50d95b2c1 - Sigstore transparency entry: 833755609
- Sigstore integration time:
-
Permalink:
aaishwarymishra/tinkerbell@0838f2bbcc7a9e6f0f61559696fee18eefa46998 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/aaishwarymishra
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@0838f2bbcc7a9e6f0f61559696fee18eefa46998 -
Trigger Event:
push
-
Statement type: