Skip to main content

Utilities for ML models targeting hardware triggers

Project description

Machine Learning for Hardware Triggers

triggerflow 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 triggerflow

Usage

from triggerflow.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.

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

triggerflow-0.1.10.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

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

triggerflow-0.1.10-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file triggerflow-0.1.10.tar.gz.

File metadata

  • Download URL: triggerflow-0.1.10.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for triggerflow-0.1.10.tar.gz
Algorithm Hash digest
SHA256 4006d4074dae98a6a48a82bf48133e44f7ee4ac4b3185f499314bce3ef539797
MD5 92eae45b4bb4781ed3bac5b123aa6e1e
BLAKE2b-256 d5ac912027c14986d62ce5ad2246854c0135441f2fd190f41a283946ce1af114

See more details on using hashes here.

File details

Details for the file triggerflow-0.1.10-py3-none-any.whl.

File metadata

  • Download URL: triggerflow-0.1.10-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for triggerflow-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 f293ad12cfd94c5f4fe61fd6886285e906a856d42866c03cb5913df48026908c
MD5 fe912521018f477130865821769c336f
BLAKE2b-256 03adc788a7475a6f2f636d4c9d33b3858f6a43e676ea2e33ff06ae917b3ec601

See more details on using hashes here.

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