Metadata-Version: 2.1
Name: nabla-ml
Version: 25.5291223
Summary: Dynamic neural networks and function transformations in Python + Mojo
Author-email: TilliFe <tillmann.fehrenbach@gmail.com>
Project-URL: Homepage, https://github.com/nabla-ml/nabla
Project-URL: Repository, https://github.com/nabla-ml/nabla
Project-URL: Bug Tracker, https://github.com/nabla-ml/nabla/issues
Keywords: deep learning,machine learning,jax,autodiff,nabla,mojo,max,gpu,vmap,grad
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: numpy>=1.22.0
Requires-Dist: modular>=25.0.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: black; extra == "dev"
Requires-Dist: mypy; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: pre-commit; extra == "dev"

[![Development Status](https://img.shields.io/badge/status-pre--alpha-red)](https://github.com/nabla-ml/nabla)
[![PyPI version](https://badge.fury.io/py/nabla-ml.svg)](https://pypi.org/project/nabla-ml/)
[![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)


# NABLA

### Dynamic Neural Networks and Function Transformations in Python + Mojo

*Nabla provides 3 things:*

- **Multidimensional array operations**: Support for binary, unary, and linear algebra operations on multi-dimensional arrays (Tensors) on CPU and GPU.
- **Dynamic function transformations**: Apply JAX-like transformations like `vmap`, `grad`, `jit` to Python functions.
- **Mojo acceleration 🔥**: Seamlessly integrate high-performance Mojo kernels for CPU and GPU execution. ([Learn more →](https://docs.modular.com/mojo/manual/gpu/basics/))


## Installation

**📦 Now available on PyPI!**

```bash
pip install nabla-ml
```

**Requirements**: Python 3.10+, NumPy, Modular (Mojo + MAX for JIT/GPU support)

### Development Installation

For contributors and development work:

```bash
git clone https://github.com/nabla-ml/nabla.git
cd nabla

# Create virtual environment (recommended)
python -m venv .venv
source .venv/bin/activate

# Install in development mode
pip install -e ".[dev]"
```

## Development Setup

### Development Setup

For contributors and advanced users:

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

# Run tests
pytest

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

## Quick Start

```python
import nabla
from nabla import grad, vmap

# Create arrays
x = nabla.array([1.0, 2.0, 3.0])
y = nabla.array([4.0, 5.0, 6.0])

# Basic operations
z = x + y * 2.0
print(z)  # [9.0, 12.0, 15.0]

# Function transformations
def f(x):
    return x ** 2 + 3 * x

# Compute gradients
grad_f = grad(f)
print(grad_f(2.0))  # 7.0 (derivative: 2*x + 3 at x=2)

# Vectorize functions
vmap_f = vmap(f)
result = vmap_f(nabla.array([1.0, 2.0, 3.0]))
print(result)  # [4.0, 10.0, 18.0]
```

## Roadmap

- ✅ **Function Transformations**: `vmap`, `grad`, `jit`, `vjp`, `jvp`
- ✅ **Mojo Kernel Integration**: CPU/GPU acceleration working
- 👷 **Extended Operations**: Comprehensive math operations
- 💡 **Enhanced Mojo API**: When Mojo ecosystem stabilizes

## Repository Structure

```
nabla/
├── nabla/                     # Core Python library
│   ├── core/                  # Function transformations and array operations
│   ├── ops/                   # Mathematical operations (binary, unary, linalg)
│   ├── mojo_kernels/          # High-performance Mojo kernels
│   ├── nn/                    # Neural network layers and utilities
│   └── utils/                 # Utilities (broadcasting, types)
├── tests/                     # Comprehensive test suite
└── nabla-mojo/                # Experimental pure Mojo API
```

## Status (Research Preview)

- **API Stability**: Subject to change
- **Completeness**: Growing operator coverage  
- **Documentation**: Basic; expanding soon
- **Bugs**: Please report issues!

## 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](https://github.com/nabla-ml/nabla/blob/main/LICENSE).

---

<p align="center" style="margin-top: 3em; margin-bottom: 2em;"><em>Thank you for checking out Nabla!</em></p>

