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 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nabla_ml-25.6120930.tar.gz.
File metadata
- Download URL: nabla_ml-25.6120930.tar.gz
- Upload date:
- Size: 119.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
325747b7f6261131317b079c5208811c86f32e9c5ed71cf96a5fb336f6f88919
|
|
| MD5 |
eaf112a640c8debf538e9e313bed47fa
|
|
| BLAKE2b-256 |
49182b0e7f301821111bf1b1e955d3a83c3537df9e456c738868aee8353c0648
|
File details
Details for the file nabla_ml-25.6120930-py3-none-any.whl.
File metadata
- Download URL: nabla_ml-25.6120930-py3-none-any.whl
- Upload date:
- Size: 180.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c727564b480ed818d6427aaf7eb3848064bf76d033508cecc5f5902c0222cefc
|
|
| MD5 |
16900e74db51106533c790b6131e0ff1
|
|
| BLAKE2b-256 |
4513d75b8f68cefe318ecc1f39106d50f2b1a6a63abf4cee0730096bf4951be7
|