Skip to main content

Machine Learning for Hardware Triggers

trigger_model provides a set of utilities for Machine Learning models targeting FPGA deployment. The TriggerModel class consolidates several Machine Learning frontends and compiler backends to construct a "trigger model". MLflow utilities are for logging, versioning, and loading of trigger models.

Installation

pip install trigger_model

Usage

from trigger_model.core import TriggerModel 

trigger_model = TriggerModel(name="my-trigger-model", ml_backend="Keras", compiler="hls4ml", model, compiler_config or None)
trigger_model() # call the constructor

# then:
output_software = trigger_model.software_predict(input_data)
output_firmware = trigger_model.firmware_predict(input_data)
output_qonnx = trigger_model.qonnx_predict(input_data)

# save and load trigger models:
trigger_model.save("trigger_model.tar.xz")

# in a separate session:
from trigger_model.core import TriggerModel 
trigger_model = TriggerModel.load("trigger_model.tar.xz")

Logging with MLflow

# logging with MLFlow:
import mlflow
from trigger_model.mlflow_wrapper import log_model

mlflow.set_tracking_uri("https://ngt.cern.ch/models")
experiment_id = mlflow.create_experiment("example-experiment")

with mlflow.start_run(run_name="trial-v1", experiment_id=experiment_id):
    log_model(trigger_model, registered_model_name="TriggerModel")

Note: This package doesn't install dependencies so it won't disrupt specific training environments or custom compilers. For a reference environment, see environment.yml.

Metadata

Release files for trigger-model 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trigger-model 0.1.3
File Size Uploaded Provenance Actions
trigger_model-0.1.3.tar.gz 9.1 kB Without provenance Details for trigger_model-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for trigger-model 0.1.3
File Interpreter ABI Platform Actions
trigger_model-0.1.3-py3-none-any.whl Python 3 none any Details for trigger_model-0.1.3-py3-none-any.whl

Total release size: 17.4 kB

Release files / trigger_model-0.1.3.tar.gz

Download URL trigger_model-0.1.3.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
99ebe8f2b8c500771eb72a7fb7c779bc134f212ff82ca29ea7cb9304de01dbe2
BLAKE2b-256 checksum
How to use checksums
1f60c1c6398a4bb9490a3159b4b90da4dc8776d47cc5f247cf1d208b5028fc9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Release files / trigger_model-0.1.3-py3-none-any.whl

Download URL trigger_model-0.1.3-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35892de8c52d842bc1d2e1a09a880d18b1f9b784aa4c053cae86eb2c8575cfac
BLAKE2b-256 checksum
How to use checksums
6ce151a0c2d5724a7eda2ff37ce2f2bdaa1cdf7a8a39aea741072ea51c0b8e24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.18

Security for trigger-model 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page