Skip to main content

Utilities for ML models targeting hardware triggers

Project description

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.

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

trigger_model-0.1.3.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

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

trigger_model-0.1.3-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file trigger_model-0.1.3.tar.gz.

File metadata

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

File hashes

Hashes for trigger_model-0.1.3.tar.gz
Algorithm Hash digest
SHA256 99ebe8f2b8c500771eb72a7fb7c779bc134f212ff82ca29ea7cb9304de01dbe2
MD5 f251aff27763e1600e358da24e503ee5
BLAKE2b-256 1f60c1c6398a4bb9490a3159b4b90da4dc8776d47cc5f247cf1d208b5028fc9a

See more details on using hashes here.

File details

Details for the file trigger_model-0.1.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for trigger_model-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 35892de8c52d842bc1d2e1a09a880d18b1f9b784aa4c053cae86eb2c8575cfac
MD5 deb97dc09431e5fe45ed2a99d5087056
BLAKE2b-256 6ce151a0c2d5724a7eda2ff37ce2f2bdaa1cdf7a8a39aea741072ea51c0b8e24

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