Skip to main content

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 FunctionBlock and Layer abstractions.
  • 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

  1. Clone the repository:

    git clone https://github.com/yourusername/tinkerbell.git
    cd tinkerbell
    
  2. 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

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

tinkerbell-0.1.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

tinkerbell-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

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

Hashes for tinkerbell-0.1.0.tar.gz
Algorithm Hash digest
SHA256 47709f9586eb2f6d73f6e3c8238782fb3b83c8b044b08a0478e64e7a869ddf5b
MD5 f08d77147c0bf99caadc2ac01bcfbb78
BLAKE2b-256 fc5ad00a7b9f8d9eb644e038408c79694b9bc6f2d61571c17f23a6904b0d436c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinkerbell-0.1.0.tar.gz:

Publisher: pypi-publish.yml on aaishwarymishra/tinkerbell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for tinkerbell-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc0fce7991bae7138d25528925c48d3f4d6dfd90080fed2c4fffa1f50d95b2c1
MD5 43b99521d78aa9ed83c540e5c88f4f7f
BLAKE2b-256 1d5ee8af76ad92eb15454ad3c3db170c13ae8d5e586dd4bfca32fd6e6c756d89

See more details on using hashes here.

Provenance

The following attestation bundles were made for tinkerbell-0.1.0-py3-none-any.whl:

Publisher: pypi-publish.yml on aaishwarymishra/tinkerbell

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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