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.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.0
File Size Uploaded
neuralfabric-1.0.tar.gz 16.6 kB Details

Built distribution (wheel)

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

Total release size: 44.7 kB

Release files / neuralfabric-1.0.tar.gz

Download URL neuralfabric-1.0.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e671e96335e650af1c85fe8d3de63bc2e94164a171a956e0d8ab6c63ec14f9f0
BLAKE2b-256 checksum
How to use checksums
83067c467b47ecbcb011d3224a723b825a322bc34e953964d14bf111141051b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

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

Download URL neuralfabric-1.0-py3-none-any.whl
Size 28.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
336d10a9710b9179c2e616d63b02611e263ccf77f16ee2bea488ed9ae40bc943
BLAKE2b-256 checksum
How to use checksums
4fadf9fcd59731348b6f4b95c39f18bc19c95477c0dc796f90f6155d2f0da3e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 22, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

This release

1.0 This release

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