kabena — K-ABENA (v2.1.0)
Même modèle, ~28 % de calcul en moins. K-ABENA exclut à chaque époque une partie des exemples déjà appris et fait voter chaque exemple conservé au nom des dispensés (repondération Horvitz-Thompson) : le gradient reste design-unbiased — preuves et mesures dans le preprint.
La promesse : 2 lignes
from kabena import Kabena
kb = Kabena() # 1. défauts du preprint (v3, N=0.3)
for epoch in range(E):
losses = per_sample_loss(model, X, y)
active, w = kb.select(losses, y=y) # 2. masque + poids HT
model.fit(X[active], y[active], sample_weight=w[active])
print(kb.last_gain_) # fraction de calcul économisée
PyTorch : KabenaTorch().reduce(losses) · Keras : callback KabenaKeras ·
Hugging Face : KabenaTrainer.
Trois paramètres, pas un de plus
| Paramètre | Défaut | Rôle |
|---|---|---|
N |
0.3 |
proportion de mineures conservées (budget) |
strategy |
"auto" |
auto(=v3) / v3 / v2 / v1 — bascule transparente |
seed |
None |
reproductibilité du tirage |
v2 = mode régularisé optionnel (garde-fou automatique hors zone de
validité) · v1 = compatibilité 1.x.
Tutoriels — 4 familles × 3 niveaux
| Famille | Niveau 1 (notebook) | Niveau 2 (script) | Niveau 3 (MLOps) |
|---|---|---|---|
| ML classique (logistique, SVM, softmax) | notebook | script | train + serve + Docker |
| MLP / ANN (PyTorch et TF/Keras) | notebook | PyTorch · TensorFlow | pipeline TorchScript |
| CNN (PyTorch et TF/Keras) | notebook | PyTorch · TensorFlow | SavedModel / TF Serving |
| Transformer / NLP (Hugging Face) | notebook | DistilBERT | fine-tune + serve |
Reproduire le preprint (Reproducibility)
Chaque table du papier a son script seedé dans
validation/ :
| Table du preprint | Script |
|---|---|
| Table 1 — jeux réels, parité à coût réduit | table1_real_datasets.py |
| Table 2 — déséquilibre extrême 0,17 % | table2_extreme_imbalance.py |
| Table 3 — moments du gradient, bruit | table3_moments_noise.py |
| Table 4 — rivaux à budget égal (tests de permutation) | table4_rivals.py |
| §Sensitivity — grille K × N | table5_sensitivity.py |
python validation/run_all.py # les 5 tables (QUICK=1 pour un smoke test <2 min)
python experiments/playground.py --regime fraude --strategy v3 # bac à sable
Installation
pip install kabena # coeur (numpy seul)
pip install "kabena[sklearn]" # + helpers scikit-learn
pip install "kabena[torch]" # + intégration PyTorch
pip install "kabena[tensorflow]" # + intégration Keras
pip install "kabena[huggingface]" # + KabenaTrainer
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 kabena-2.1.0.tar.gz.
File metadata
- Download URL: kabena-2.1.0.tar.gz
- Upload date:
- Size: 32.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
510fb55cd0d07482f2f0a4f21ef4d17a191c8bfabd4a4bbc41d94040b210b777
|
|
| MD5 |
8919f32afd9e9be5898ddb6ac4ccb391
|
|
| BLAKE2b-256 |
4ccf0fccbe95d56ee50cf62802c9d0e18d52474b97a0f8d9e53450123eaae44f
|
Provenance
The following attestation bundles were made for kabena-2.1.0.tar.gz:
Publisher:
release.yml on Bonbhel/kabena-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kabena-2.1.0.tar.gz -
Subject digest:
510fb55cd0d07482f2f0a4f21ef4d17a191c8bfabd4a4bbc41d94040b210b777 - Sigstore transparency entry: 2089345710
- Sigstore integration time:
-
Permalink:
Bonbhel/kabena-ml@54be40f76654da81ad15f220a16552060f481d24 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/Bonbhel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54be40f76654da81ad15f220a16552060f481d24 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kabena-2.1.0-py3-none-any.whl.
File metadata
- Download URL: kabena-2.1.0-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cfc351f980290e5282e512633ed3e89690f0915c145f10c876e78faca56455fe
|
|
| MD5 |
fba70cc9b910a7f0ebab5ebca7ded481
|
|
| BLAKE2b-256 |
d516942d433b076d4bfe7cd89b61c7b974a26f8342236d18c0f6d79ea86c3de3
|
Provenance
The following attestation bundles were made for kabena-2.1.0-py3-none-any.whl:
Publisher:
release.yml on Bonbhel/kabena-ml
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kabena-2.1.0-py3-none-any.whl -
Subject digest:
cfc351f980290e5282e512633ed3e89690f0915c145f10c876e78faca56455fe - Sigstore transparency entry: 2089345848
- Sigstore integration time:
-
Permalink:
Bonbhel/kabena-ml@54be40f76654da81ad15f220a16552060f481d24 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/Bonbhel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@54be40f76654da81ad15f220a16552060f481d24 -
Trigger Event:
push
-
Statement type: