Skip to main content

Dynamic neural networks and function transformations in Python + Mojo

Project description

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 other Automatic Differentiation tools
  • Deep integration with MAX and (custom) Mojo kernels

For tutorials and API reference, visit: nablaml.com

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/                  # Array class and MAX compiler integration
│   ├── nn/                    # Neural network modules and models
│   ├── ops/                   # Mathematical operations (binary, unary, linalg, etc.)
│   ├── transforms/            # Function transformations (vmap, grad, jit, etc.)
│   └── utils/                 # Utilities (formatting, types, MAX-interop, etc.)
├── tests/                     # Comprehensive test suite
├── tutorials/                 # Notebooks on Nabla usage for ML tasks
├── examples/                  # Example scripts for common use cases
└── experimental/              # Core (pure) Mojo library (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!

Development Status PyPI version Python 3.12+ License: Apache 2.0

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.6191209.tar.gz (146.0 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.6191209-py3-none-any.whl (205.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nabla_ml-25.6191209.tar.gz
  • Upload date:
  • Size: 146.0 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.6191209.tar.gz
Algorithm Hash digest
SHA256 92c0e743e153f07639bc61a74c7256c3ca6d38914b49188ac88f5ea707fa13ad
MD5 01bc92de6358fc7ca6cd6ba155b48e00
BLAKE2b-256 0e11eb1be957561c7d2c91d1c1df956ae1aa7c3ea3f4e3e7a00e9d58009de205

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nabla_ml-25.6191209-py3-none-any.whl
  • Upload date:
  • Size: 205.3 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.6191209-py3-none-any.whl
Algorithm Hash digest
SHA256 9b1f8cf1053babd9d09216f19f01dfde94111dfce2cf66e57ccf8e4284170de6
MD5 570be65a0e8329f4d895e5f3e90e6694
BLAKE2b-256 3de48b5f168b6c9355d8994ad1b09221d01ad9b171a8047bc1bdb1329aca94a7

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