Skip to main content

🌌 Sorix

Sorix training animation

PyPI version Tests status License: MIT GitHub stars


Sorix is a high-performance, minimalist deep learning library built on top of NumPy/CuPy. Designed for research and production environments where efficiency and a clean API matter. If you know PyTorch, you already know how to use Sorix.

📖 Read the Full Documentation


🚀 Key Features

  • ⚡ High Performance: Run optimized neural networks on NumPy (CPU) or CuPy (GPU).
  • 🧩 PyTorch-like API: Familiar and expressive syntax for a near-zero learning curve.
  • 🍃 Lightweight: Minimal dependencies, ideal for resource-constrained environments.
  • 🛠️ Production Ready: Straight path from prototype to real-world deployment.
  • 📈 Autograd Engine: Simple yet powerful automatic differentiation.

📊 Benchmark Results

Sorix outpaces the giants in resource efficiency while matching them in speed. In our MNIST benchmark, Sorix demonstrates its extreme lightweight nature:

Library CPU Size GPU Size Training (CPU) Accuracy
Sorix ~54 MB ~238 MB ~7.3s 97.2%
PyTorch ~737 MB ~6.8 GB ~9.21s 97.4%
TensorFlow ~1.4 GB ~2.0 GB ~17.14s 96.8%

💡 Tip: Sorix is ~28x smaller than PyTorch for GPU support and ~13x smaller on CPU, making it the perfect choice for serverless environments (like AWS Lambda) and edge computing.

👉 Full Benchmark Report


📦 Installation

Choose your preferred package manager:

Using pip:

pip install sorix

Using uv:

uv add sorix

Using Poetry:

poetry add sorix

Note for GPU support: Install the CuPy extra using pip install "sorix[cp13]" (Requires CuPy v13 and CUDA).


⚡ Full Pipeline: Define, Train, Save & Load

Building a neural network, training it, and persisting it for later use is straightforward:

import numpy as np
from sorix import tensor, save, load
from sorix.nn import Sequential, Linear, ReLU, MSELoss
from sorix.optim import SGD

# 1. Prepare data (y = 3x^2 + 2)
X = np.linspace(-1, 1, 100).reshape(-1, 1)
y = 3 * X**2 + 2 + 0.1 * np.random.randn(*X.shape)
X_t, y_t = tensor(X), tensor(y)

# 2. Define a multi-layer model
model = Sequential(
    Linear(1, 10),
    ReLU(),
    Linear(10, 1)
)

# 3. Define loss and optimizer
criterion = MSELoss()
optimizer = SGD(model.parameters(), lr=0.01)

# 4. Training loop
for epoch in range(1000):
    y_pred = model(X_t)
    loss = criterion(y_pred, y_t)

    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

    if (epoch + 1) % 200 == 0:
        print(f"Epoch {epoch+1}, Loss: {loss.item():.4f}")

# 5. Save the model
save(model, "model.sor")

# 6. Load and verify
model_loaded = load("model.sor")
test_val = tensor([[0.5]])
print(f"Prediction for 0.5: {model_loaded(test_val).item():.4f}")

📖 Learn & Examples

Learn Sorix through interactive notebooks. Open them directly in Google Colab:

Topic Documentation Colab
Tensor Basics Tensors Guide Open In Colab
Autograd Engine Autograd Guide Open In Colab
Module Basics Module Guide Open In Colab
Linear Regression Regression Guide Open In Colab
MNIST Classification MNIST Guide Open In Colab

🛠️ Roadmap

  • Core Autograd Engine (NumPy/CuPy backends)
  • Basic Layers: Linear, ReLU, Sigmoid, Tanh, BatchNorm1D, Dropout
  • Optimizers: SGD, Adam, RMSprop
  • GPU Acceleration via CuPy
  • Sequential API
  • Convolutional Layers (Conv2d, MaxPool2d)
  • Advanced Initializations (Kaiming, Orthogonal)
  • Data Loaders & Datasets

🤝 Contribution

We appreciate any contribution from the community!

  1. Report Bugs: Open an Issue.
  2. Add Features: Submit a Pull Request.
  3. Improve Docs: Help us make the documentation better.
  4. Write Tests: Improve our code coverage.

📌 Links


Made with ❤️ for the AI Community

Metadata

Release files for sorix 1.0.7

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

Source distribution (sdist)

Source distribution for sorix 1.0.7
File Size Uploaded Provenance
sorix-1.0.7.tar.gz 2.5 MB With provenance Details

Built distribution (wheel)

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

Total release size: 2.6 MB

Release files / sorix-1.0.7.tar.gz

Download URL sorix-1.0.7.tar.gz
Size 2.5 MB
Tags Source
SHA-256 checksum
How to use checksums
d1c6a5d4d40495737671ab5ef3d6b6bec13c0d650e736060df88ce48d66fef3d
BLAKE2b-256 checksum
How to use checksums
a5075c6264b480a4c6e5a1452ae30399dcf120ec3c8f56335aa310cef6106cee
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 7, 2026.

Transparency log

Release files / sorix-1.0.7-py3-none-any.whl

Download URL sorix-1.0.7-py3-none-any.whl
Size 53.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b9558db880bf55fb92f30128484e9e57af9c68751d97eaf0d3491b1a7530a12
BLAKE2b-256 checksum
How to use checksums
876544d388cc8b325cddb3323c2451e3c2514818113b9194b147ee7ecf1df0ca
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 7, 2026.

Transparency log

Security for sorix 1.0.7

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sorix-1.0.7.tar.gz

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

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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