Skip to main content

A minimalistic and high-performance Machine Learning library based on NumPy

Project description

🌌 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.

📦 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).


⚡ Sorix in 30 Seconds

Building and training a model is intuitive. Here is a complete training loop:

import numpy as np
from sorix import tensor
from sorix.nn import Linear, MSELoss
from sorix.optim import SGD

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

# 2. Define model, loss, and optimizer
model = Linear(1, 1) # Simple y = Wx + b
criterion = MSELoss()
optimizer = SGD(model.parameters(), lr=0.1)

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

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

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

# Learned: y = 3.00x + 2.00
print(f"Learned: y = {model.W.item():.2f}x + {model.b.item():.2f}")

📖 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
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
  • Optimizers: SGD, Adam, RMSprop
  • GPU Acceleration via CuPy
  • Sequential API (Coming soon)
  • Convolutional Layers (Conv2d, MaxPool2d)
  • Dropout & Regularization
  • Advanced Initializations (Kaiming, Orthogonal)

🤝 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

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

sorix-1.0.1.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

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

sorix-1.0.1-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file sorix-1.0.1.tar.gz.

File metadata

  • Download URL: sorix-1.0.1.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sorix-1.0.1.tar.gz
Algorithm Hash digest
SHA256 eafb5744872d257d4788e96e99e01d7525ba560c85392cd8433866ccd9383529
MD5 4f7f2516a32fabda61fcf12bf27e72f6
BLAKE2b-256 e9651c06a71c32d3d0c7245d5ed66c03a7eb5d7b77fcf1b1c9d159e8770b6d98

See more details on using hashes here.

Provenance

The following attestation bundles were made for sorix-1.0.1.tar.gz:

Publisher: pypi_publish.yml on Mitchell-Mirano/sorix

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

File details

Details for the file sorix-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: sorix-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sorix-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d0ec496ee28dea50b5cbb0e539fe14d1cf03e3f6c79a40a37be4acb79a34e4a1
MD5 c4728069355e2de747d7efb6fb674bce
BLAKE2b-256 6ff92d137e0b22a703d08f1560437b47a6adbaa67b48cac3240efef90f79dc4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sorix-1.0.1-py3-none-any.whl:

Publisher: pypi_publish.yml on Mitchell-Mirano/sorix

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