Metadata-Version: 2.4
Name: entlearn
Version: 0.1.1
Summary: Tensor-native entropic-learning primitives for PyTorch
Author: Davide Bassetti, Michael Groom
Author-email: Davide Bassetti <bassetti.davide@math.rptu.de>, Michael Groom <michael.groom@csiro.au>
License-Expression: AGPL-3.0-only
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Dist: numpy>=2.5.2
Requires-Dist: safetensors>=0.8.0
Requires-Dist: torch>=2.12.0
Requires-Dist: plotly>=6.0 ; extra == 'plotting'
Requires-Dist: rich>=14 ; extra == 'rich'
Requires-Dist: joblib>=1.4 ; extra == 'sklearn'
Requires-Dist: narwhals>=2.21.2 ; extra == 'sklearn'
Requires-Dist: scikit-learn>=1.9.0 ; extra == 'sklearn'
Requires-Python: >=3.13
Project-URL: Documentation, https://entropiclearning.github.io/entlearn/
Project-URL: Source, https://github.com/EntropicLearning/entlearn
Project-URL: Issues, https://github.com/EntropicLearning/entlearn/issues
Provides-Extra: plotting
Provides-Extra: rich
Provides-Extra: sklearn
Description-Content-Type: text/markdown

# Entlearn

[![PyPI version](https://img.shields.io/pypi/v/entlearn.svg)](https://pypi.org/project/entlearn/) [![Python versions](https://img.shields.io/pypi/pyversions/entlearn.svg)](https://pypi.org/project/entlearn/) [![CI](https://github.com/EntropicLearning/entlearn/actions/workflows/ci.yml/badge.svg)](https://github.com/EntropicLearning/entlearn/actions/workflows/ci.yml) [![Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://entropiclearning.github.io/entlearn/) [![Licence](https://img.shields.io/github/license/EntropicLearning/entlearn.svg)](https://github.com/EntropicLearning/entlearn/blob/main/LICENSE)

`entlearn` is a pure-tensor PyTorch implementation of Entropy-Optimal Networks (EON):
entropy-regularised clusterings stacked as blocks and fitted by exact block-coordinate descent.

[Documentation](https://entropiclearning.github.io/entlearn/) · [Examples](https://github.com/EntropicLearning/entlearn/tree/main/examples) · [Skills](https://github.com/EntropicLearning/entlearn_skills) · [Contributing](https://github.com/EntropicLearning/entlearn/blob/main/CONTRIBUTING.md)

## Quick start

```bash
pip install entlearn  # or: uv add entlearn
```

```python
import torch
from entlearn import ClassificationHead, Input, Network, Recipe

X = torch.rand(200, 4, dtype=torch.float64)
y = (X[:, 0] > 0.5).long()
recipe = Recipe.chain(Input(K=8, epsilon=0.01), ClassificationHead())
network = Network.fit(recipe, X, y)
predictions = network.predict(X).argmax(dim=-1)
```

## Licence

`entlearn` is free software under the
[GNU AGPL-3.0](https://github.com/EntropicLearning/entlearn/blob/main/LICENSE). You may use,
study, change and share it; if you distribute it, or run a changed version as a service for
others, you share your source code under the same licence.

## Citation

If you use `entlearn`, please cite Bassetti et al. (2025),
[An entropy-optimal path to humble AI](https://arxiv.org/abs/2506.17940).
[CITATION.cff](https://github.com/EntropicLearning/entlearn/blob/main/CITATION.cff) also gives the software citation.

## Funding

This work has received support from the AI4LUNGS project, funded by the European Union's
Horizon 2020 research and innovation programme. AI4LUNGS applies AI to medical data, but EON
is a general-purpose method that applies to many domains beyond healthcare.
