Metadata-Version: 2.4
Name: addernet
Version: 1.6.0
Summary: Multiplication-free lookup neural models with scalar, multi-input, HDC, and additive APIs
Author: AdderNet Team
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/PedroHenriqueBatistaSilva/AdderNet
Project-URL: Repository, https://github.com/PedroHenriqueBatistaSilva/AdderNet
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: C
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: scipy>=1.10
Requires-Dist: scikit-learn>=1.3
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: build>=1; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Dynamic: license-file

# AdderNet 1.6 development fork

This directory contains an audited and extended version of the `addernet` 1.5.0
package. It keeps the original scalar, HDC, attention, boosting, clustering, and
additive APIs while adding safer native bindings and genuine multi-input models.

## Main additions

- `AdderNetLayer.fit(...)`: direct O(n + range) scalar LUT fitting.
- `AdderNetLayer.partial_fit(...)`: blended streaming updates.
- Explicit `close()` and context-manager lifecycle.
- Atomic native saves and portable versioned `.npz` saves.
- Hardened native file loading and full validation of C arguments.
- `AdderNetMultiInputLayer`: N inputs, one or more outputs, additive and pairwise LUTs.
- `AdderNetRegressor`: alias for the multi-input regression model.
- `AdderNetClassifier`: classification wrapper with arbitrary class labels.
- Improved `UniformQuantizer` with feature-shape validation and inverse transform.
- OpenMP changed to opt-in because it slowed the memory-bound scalar lookup on the test host.

## Two-input example

```python
import numpy as np
from addernet import AdderNetMultiInputLayer

x = np.arange(32)
y = np.arange(32)
xx, yy = np.meshgrid(x, y, indexing="ij")
X = np.column_stack([xx.ravel(), yy.ravel()])
target = (xx * yy).ravel()

model = AdderNetMultiInputLayer(bins=32, interactions="auto")
model.fit(X, target)

print(model.predict(7, 9))  # approximately 63
print(model.predict_batch([[2, 3], [4, 5]]))
```

## Build and test

```bash
python -m pip install -e .
addernet-selftest
python -m pytest
```

Set `ADDERNET_OPENMP=1` before building only after benchmarking on the target
hardware. The default single-threaded native loop is often faster for this LUT.
