Skip to main content

GATO: Gradient-based categorization optimization for HEP analyses

Project description

gato-hep: Gradient-based Categorization Optimizer for High Energy Physics

Documentation Status

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


  1. git checkout -b feature/xyz
  2. Code under src/gatohep/, add tests under tests/.
  3. Update version in pyproject.toml.
  4. black / isort / pytest, then open a PR.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gato_hep-0.1.0.tar.gz (26.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gato_hep-0.1.0-py3-none-any.whl (26.5 kB view details)

Uploaded Python 3

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

Hashes for gato_hep-0.1.0.tar.gz
Algorithm Hash digest
SHA256 875e152a2ac0076374625cd06fdbfd757aacadbc64c734438f32b231028620e5
MD5 d2a07f9e58a05c52ee9c76d527c2d18b
BLAKE2b-256 f9d17db0d940112872205925f9c694f7e81b88ebffab6a6bbe5ee5046e85d307

See more details on using hashes here.

Provenance

The following attestation bundles were made for gato_hep-0.1.0.tar.gz:

Publisher: release.yml on FloMau/gato-hep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for gato_hep-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a8d3510f0bbb9bf427a64fbc4100c13ff7074e75c47acd21005310c993a761f2
MD5 8aa9c5dfbea26b3d774b29f49b7070ab
BLAKE2b-256 35851373c5c0c392546f7606f1e763c86bd54409b640035d50ae4b5ff8d5c9dc

See more details on using hashes here.

Provenance

The following attestation bundles were made for gato_hep-0.1.0-py3-none-any.whl:

Publisher: release.yml on FloMau/gato-hep

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page