GATO: Gradient-based categorization optimization for HEP analyses
Project description
gato-hep: Gradient-based Categorization Optimizer for High Energy Physics
A toolkit for binning / categorisation optimisation with respect to signal significance for HEP analyses, using gradient-descent methods. gatohep relies on TensorFlow with TensorFlow-Probability.
The categorisation can be performed directly in a multidimensional discriminant space, e.g. from a mutliclassifier with softmax activation. The bins are defined by learnable multidimensional Gaussians as a Gaussian Mixture Model (GMM), or, well working in 1D, using bin boundaries approximated by steep sigmoid functions of learnable position.
See the full documentation at https://gato-hep.readthedocs.io/.
Quick install (editable mode)
git clone https://github.com/FloMau/gato-hep.git
cd gato-hep
python3 -m venv gato_env # or use conda
source gato_env/bin/activate
pip install -e .
Dependencies are declared in pyproject.toml. Note: The only tricky part is to find matching versions of tensorflow, tensorflow-probability and ml-dtypes. The requirements mentioned here should work, however, other combinations may work as well.
Running the toy examples
1D toy (signal vs. multi-background)
python examples/1D_example/run_toy_example.py
3-class soft-max (2 D slice of 3 D)
python examples/three_class_softmax_example/run_example.py
Each script writes plots & a significance comparison table.
Apply gato-hep to your own data
# standard GMM model for ND optimisation
from gatohep.models import gato_gmm_model
# more to be included here later on
# see ./examples for a full workflow!
Directory layout
gato-hep/ project root
│
├─ pyproject.toml metadata + dependencies
├─ src/gatohep/ installable Python package
│ │
│ ├─ __init__.py
│ ├─ models.py Trainable model class
│ └─ losses.py custom loss / penalty terms
│ ├─ utils.py misc helpers
│ ├─ plotting_utils.py helper plots (stacked hists, bin boundaries, ...)
│ ├─ data_generation.py toy data generators (1D / 3-class softmax)
│
└─ examples/ runnable demos
├─ 1D_example/run_example.py
└─ three_class_softmax_example/run_example.py
Contributing
git checkout -b feature/xyz- Code under src/gatohep/, add tests under tests/.
- Update version in pyproject.toml.
black/isort/pytest, then open a PR.
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 gato_hep-0.1.0.tar.gz.
File metadata
- Download URL: gato_hep-0.1.0.tar.gz
- Upload date:
- Size: 26.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
875e152a2ac0076374625cd06fdbfd757aacadbc64c734438f32b231028620e5
|
|
| MD5 |
d2a07f9e58a05c52ee9c76d527c2d18b
|
|
| BLAKE2b-256 |
f9d17db0d940112872205925f9c694f7e81b88ebffab6a6bbe5ee5046e85d307
|
Provenance
The following attestation bundles were made for gato_hep-0.1.0.tar.gz:
Publisher:
release.yml on FloMau/gato-hep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gato_hep-0.1.0.tar.gz -
Subject digest:
875e152a2ac0076374625cd06fdbfd757aacadbc64c734438f32b231028620e5 - Sigstore transparency entry: 448565827
- Sigstore integration time:
-
Permalink:
FloMau/gato-hep@10eeb5e704388a52cf1ad69609e73bee945393b8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FloMau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@10eeb5e704388a52cf1ad69609e73bee945393b8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gato_hep-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gato_hep-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a8d3510f0bbb9bf427a64fbc4100c13ff7074e75c47acd21005310c993a761f2
|
|
| MD5 |
8aa9c5dfbea26b3d774b29f49b7070ab
|
|
| BLAKE2b-256 |
35851373c5c0c392546f7606f1e763c86bd54409b640035d50ae4b5ff8d5c9dc
|
Provenance
The following attestation bundles were made for gato_hep-0.1.0-py3-none-any.whl:
Publisher:
release.yml on FloMau/gato-hep
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gato_hep-0.1.0-py3-none-any.whl -
Subject digest:
a8d3510f0bbb9bf427a64fbc4100c13ff7074e75c47acd21005310c993a761f2 - Sigstore transparency entry: 448565847
- Sigstore integration time:
-
Permalink:
FloMau/gato-hep@10eeb5e704388a52cf1ad69609e73bee945393b8 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/FloMau
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@10eeb5e704388a52cf1ad69609e73bee945393b8 -
Trigger Event:
push
-
Statement type: