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
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 triggerflow-0.1.7.tar.gz.
File metadata
- Download URL: triggerflow-0.1.7.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54656487c0eec69af92ea5ceb009a16bd963c44e27a2e9b2a7601bd80696fd1a
|
|
| MD5 |
dd55ef547d6e9975ed3c3eb8202aca62
|
|
| BLAKE2b-256 |
bbfde01a1ebe40be1822e4704a6c402c4def08cd9e538f5e027dec8e80a4bc48
|
File details
Details for the file triggerflow-0.1.7-py3-none-any.whl.
File metadata
- Download URL: triggerflow-0.1.7-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f3cb73720c8e9bf17958eedb0791ce03dc6a346a72f9097d223d50f49df93cc
|
|
| MD5 |
efd6c8ce427094573c2fd090909d21ef
|
|
| BLAKE2b-256 |
08c86bfea69634671577239b34f7bb3babe488b7859d7d80bc83344da863c64a
|