Skip to main content

NeuralFabric

A from-scratch machine learning and deep learning framework, from tensors to transformers.

Features

  • Tensor engine built on NumPy
  • Automatic differentiation (Autograd)
  • Linear Regression
  • Logistic Regression
  • Train-test split utility
  • Type-safe codebase with MyPy
  • Comprehensive test suite with Pytest
  • Ruff and Black for code quality
  • GitHub Actions CI/CD workflows
  • Modern Python packaging and PyPI distribution

Installation

pip install neuralfabric

For development:

pip install -e ".[dev]"

Quick Start

from neuralfabric.core.tensor import Tensor
from neuralfabric.linear_model import LinearRegression
from neuralfabric.model_selection import train_test_split

X = Tensor([
    [800, 2],
    [1000, 2],
    [1200, 3],
    [1500, 3],
    [1800, 4],
    [2000, 4],
    [2200, 5],
    [2500, 5],
])

y = Tensor([
    [120000],
    [150000],
    [180000],
    [220000],
    [260000],
    [290000],
    [320000],
    [370000],
])

X_train, X_test, y_train, y_test = train_test_split(
    X,
    y,
    test_size=0.25,
    random_state=42,
)

model = LinearRegression(
    lr=1e-8,
    epochs=10000,
)

model.fit(X_train, y_train)

predictions = model.predict(X_test)

print("Predictions:")
print(predictions.data)

print("\nR² Score:")
print(model.score(X_test, y_test))

Available Models

Category Model
Regression LinearRegression
Classification LogisticRegression

Project Structure

src/neuralfabric/
├── core/
│   └── Tensor and Autograd Engine
├── linear_model/
│   ├── LinearRegression
│   └── LogisticRegression
└── model_selection/
    └── train_test_split

Roadmap

Completed

  • Tensor implementation
  • Automatic differentiation engine
  • Linear Regression
  • Logistic Regression
  • Train-test split utility
  • Unit testing
  • CI/CD workflows
  • PyPI publishing

Planned

  • Decision Trees
  • Random Forests
  • Support Vector Machines
  • K-Means Clustering
  • Principal Component Analysis (PCA)
  • Neural Network API
  • Optimizers (SGD, Adam)
  • Transformer Architecture
  • Dataset utilities
  • Documentation website

Development

make dev
make test
make lint
make format
make build
make publish

Contributing

Contributions, bug reports, feature requests, and discussions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a pull request

License

Distributed under the MIT License. See the LICENSE file for details.

Metadata

Release files for neuralfabric 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for neuralfabric 1.1.0
File Size Uploaded
neuralfabric-1.1.0.tar.gz 16.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neuralfabric 1.1.0
File Interpreter ABI Platform
neuralfabric-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 43.7 kB

Release files / neuralfabric-1.1.0.tar.gz

Download URL neuralfabric-1.1.0.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d49c2766af350b7d57995338e265f357a956baa00b39bd14de87f2748b4bfe7e
BLAKE2b-256 checksum
How to use checksums
4d993cd6b2f772d1df6942af16f748800fab41cdbc8f9af6b10934699fca94d3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release files / neuralfabric-1.1.0-py3-none-any.whl

Download URL neuralfabric-1.1.0-py3-none-any.whl
Size 27.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa0406dc2339438cc9cc0369b81c256e668458710b259fe6e14c942c1b19bffb
BLAKE2b-256 checksum
How to use checksums
2fdb3d41286400d5de19b2436178befb22917e3af89af866e282362af1c9b9cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 2, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.2

2 release files

1.1.1

2 release files

This release

1.1.0 This release

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page