Skip to main content

Dynamic neural networks and function transformations in Python + Mojo

Project description

Development Status PyPI version Python 3.12+ License: Apache 2.0

NABLA

Nabla is a Python library that provides three key features:

  • Multidimensional Array computation (like NumPy) with strong GPU acceleration
  • Composable Function Transformations: vmap, grad, jit, and more
  • Deep integration with (custom) Mojo kernels

Installation

📦 Now available on PyPI!

pip install nabla-ml

Note: Nabla also includes an experimental pure Mojo API for native Mojo development.

Quick Start

import nabla as nb

# Example function using Nabla's array operations
def foo(input):
    return nb.sum(input * input, axes=0)

# Vectorize, differentiate, accelerate
foo_grads = nb.jit(nb.vmap(nb.grad(foo)))
gradients = foo_grads(nb.randn((10, 5)))

Development Setup

For contributors and advanced users:

# Clone and install in development mode
git clone https://github.com/nabla-ml/nb.git
cd nabla
pip install -e ".[dev]"

# Run tests
pytest

# Format and lint code
ruff format nabla/
ruff check nabla/ --fix

Repository Structure

nabla/
├── nabla/                     # Core Python library
│   ├── core/                  # Function transformations and core array class
│   ├── ops/                   # Mathematical operations (binary, unary, linalg, etc.)
│   ├── nn/                    # Neural network modules and models
│   └── utils/                 # Utilities (broadcasting, formatting, types)
├── tests/                     # Comprehensive test suite
├── examples/                  # Towards MLP training and other usage examples
└── experimental/              # An alternative pure Mojo API (WIP!)

Contributing

Contributions welcome! Discuss significant changes in Issues first. Submit PRs for bugs, docs, and smaller features.

License

Nabla is licensed under the Apache-2.0 license.


Thank you for checking out Nabla!

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

nabla_ml-25.6091659.tar.gz (94.2 kB view details)

Uploaded Source

Built Distribution

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

nabla_ml-25.6091659-py3-none-any.whl (121.7 kB view details)

Uploaded Python 3

File details

Details for the file nabla_ml-25.6091659.tar.gz.

File metadata

  • Download URL: nabla_ml-25.6091659.tar.gz
  • Upload date:
  • Size: 94.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for nabla_ml-25.6091659.tar.gz
Algorithm Hash digest
SHA256 07cf6b7eb9e7723960eb0830a50894934348c7f6dd7df839e2f5fbe7a9e021f9
MD5 1767542f696a66da083f8931fee3c0e3
BLAKE2b-256 9ca5aa77a43c3e8612186de49419c8ab4d27908b83ee7aed1f76c6e79e8d2810

See more details on using hashes here.

File details

Details for the file nabla_ml-25.6091659-py3-none-any.whl.

File metadata

  • Download URL: nabla_ml-25.6091659-py3-none-any.whl
  • Upload date:
  • Size: 121.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for nabla_ml-25.6091659-py3-none-any.whl
Algorithm Hash digest
SHA256 3122e2111e35dde4a86262b976fd3a7a7e73468713bc028691573e762ea19efa
MD5 c83e05a679acf7ffe62ba488c7c9cda9
BLAKE2b-256 b4040f61a6a0444c158d90a6388e5f6d81956912cacd05f9d56b7a4afc5fbdc0

See more details on using hashes here.

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