triggerflow 0.1.11__py3-none-any.whl → 0.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- trigger_dataset/__init__.py +0 -0
- trigger_dataset/core.py +88 -0
- trigger_loader/__init__.py +0 -0
- trigger_loader/cluster_manager.py +107 -0
- trigger_loader/loader.py +95 -0
- trigger_loader/processor.py +211 -0
- triggerflow/cli.py +122 -0
- triggerflow/core.py +119 -120
- triggerflow/mlflow_wrapper.py +54 -49
- triggerflow/starter/.gitignore +143 -0
- triggerflow/starter/README.md +0 -0
- triggerflow/starter/cookiecutter.json +5 -0
- triggerflow/starter/prompts.yml +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/.dvcignore +3 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/.gitignore +143 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/.gitlab-ci.yml +56 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/README.md +29 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/README.md +26 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/catalog.yml +84 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters.yml +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_compile.yml +14 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_data_processing.yml +8 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_load_data.yml +5 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_model_training.yml +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_model_validation.yml +5 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/catalog.yml +84 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters.yml +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_compile.yml +14 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_data_processing.yml +8 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_load_data.yml +5 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_model_training.yml +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_model_validation.yml +5 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/conf/logging.yml +43 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/01_raw/.gitkeep +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/01_raw/samples.json +15 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/01_raw/samples_dummy.json +26 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/02_loaded/.gitkeep +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/03_preprocessed/.gitkeep +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/04_models/.gitkeep +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/05_validation/.gitkeep +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/06_compile/.gitkeep +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/data/07_reporting/.gitkeep +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/dvc.yaml +7 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/environment.yml +21 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/pyproject.toml +50 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/__init__.py +3 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/__main__.py +25 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/any_object.py +20 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/base_dataset.py +137 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/meta_dataset.py +88 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/{{ cookiecutter.python_package }}_dataset.py +35 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/models/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/models/base_model.py +155 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/models/{{ cookiecutter.python_package }}_model.py +16 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipeline_registry.py +17 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/compile/__init__.py +10 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/compile/nodes.py +50 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/compile/pipeline.py +10 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/data_processing/__init__.py +10 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/data_processing/nodes.py +40 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/data_processing/pipeline.py +28 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/load_data/__init__.py +10 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/load_data/nodes.py +12 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/load_data/pipeline.py +20 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_training/__init__.py +10 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_training/nodes.py +31 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_training/pipeline.py +24 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_validation/__init__.py +10 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_validation/nodes.py +29 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_validation/pipeline.py +24 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/settings.py +46 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/utils/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/utils/metric.py +4 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/utils/plotting.py +598 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/compile/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/compile/test_pipeline.py +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/data_processing/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/data_processing/test_pipeline.py +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/load_data/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/load_data/test_pipeline.py +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_training/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_training/test_pipeline.py +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_validation/__init__.py +0 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_validation/test_pipeline.py +9 -0
- triggerflow/starter/{{ cookiecutter.repo_name }}/tests/test_run.py +27 -0
- triggerflow-0.2.dist-info/METADATA +97 -0
- triggerflow-0.2.dist-info/RECORD +97 -0
- triggerflow-0.2.dist-info/entry_points.txt +2 -0
- triggerflow-0.2.dist-info/top_level.txt +3 -0
- triggerflow-0.1.11.dist-info/METADATA +0 -61
- triggerflow-0.1.11.dist-info/RECORD +0 -11
- triggerflow-0.1.11.dist-info/top_level.txt +0 -1
- {triggerflow-0.1.11.dist-info → triggerflow-0.2.dist-info}/WHEEL +0 -0
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_training/test_pipeline.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This is a boilerplate test file for pipeline 'model_training'
|
|
3
|
+
generated using Kedro 1.0.0
|
|
4
|
+
Please add your pipeline tests here.
|
|
5
|
+
|
|
6
|
+
Kedro recommends using `pytest` framework, more info about it can be found
|
|
7
|
+
in the official documentation:
|
|
8
|
+
https://docs.pytest.org/en/latest/getting-started.html
|
|
9
|
+
"""
|
|
File without changes
|
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_validation/test_pipeline.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This is a boilerplate test file for pipeline 'model_validation'
|
|
3
|
+
generated using Kedro 1.0.0
|
|
4
|
+
Please add your pipeline tests here.
|
|
5
|
+
|
|
6
|
+
Kedro recommends using `pytest` framework, more info about it can be found
|
|
7
|
+
in the official documentation:
|
|
8
|
+
https://docs.pytest.org/en/latest/getting-started.html
|
|
9
|
+
"""
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""
|
|
2
|
+
This module contains example tests for a Kedro project.
|
|
3
|
+
Tests should be placed in ``src/tests``, in modules that mirror your
|
|
4
|
+
project's structure, and in files named test_*.py.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import pytest
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from kedro.framework.session import KedroSession
|
|
10
|
+
from kedro.framework.startup import bootstrap_project
|
|
11
|
+
|
|
12
|
+
# The tests below are here for the demonstration purpose
|
|
13
|
+
# and should be replaced with the ones testing the project
|
|
14
|
+
# functionality
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class TestKedroRun:
|
|
18
|
+
def test_kedro_run_no_pipeline(self):
|
|
19
|
+
# This example test expects a pipeline run failure, since
|
|
20
|
+
# the default project template contains no pipelines.
|
|
21
|
+
bootstrap_project(Path.cwd())
|
|
22
|
+
|
|
23
|
+
with pytest.raises(Exception) as excinfo:
|
|
24
|
+
with KedroSession.create(project_path=Path.cwd()) as session:
|
|
25
|
+
session.run()
|
|
26
|
+
|
|
27
|
+
assert "Pipeline contains no nodes" in str(excinfo.value)
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: triggerflow
|
|
3
|
+
Version: 0.2
|
|
4
|
+
Summary: Utilities for ML models targeting hardware triggers
|
|
5
|
+
Classifier: Programming Language :: Python :: 3
|
|
6
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
+
Classifier: Operating System :: OS Independent
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
Requires-Dist: cookiecutter>=2.3
|
|
11
|
+
Requires-Dist: PyYAML>=6
|
|
12
|
+
Requires-Dist: Jinja2>=3
|
|
13
|
+
Requires-Dist: mlflow>=2.0
|
|
14
|
+
Requires-Dist: kedro==1.0.0
|
|
15
|
+
Provides-Extra: dev
|
|
16
|
+
Requires-Dist: pytest-cov~=3.0; extra == "dev"
|
|
17
|
+
Requires-Dist: pytest-mock<2.0,>=1.7.1; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest~=7.2; extra == "dev"
|
|
19
|
+
Requires-Dist: ruff~=0.1.8; extra == "dev"
|
|
20
|
+
|
|
21
|
+
# Machine Learning for Hardware Triggers
|
|
22
|
+
|
|
23
|
+
`triggerflow` provides a set of utilities for Machine Learning models targeting FPGA deployment.
|
|
24
|
+
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.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install triggerflow
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
```python
|
|
35
|
+
|
|
36
|
+
from triggerflow.core import TriggerModel
|
|
37
|
+
|
|
38
|
+
triggerflow = TriggerModel(name="my-trigger-model", ml_backend="Keras", compiler="hls4ml", model, compiler_config or None)
|
|
39
|
+
triggerflow() # call the constructor
|
|
40
|
+
|
|
41
|
+
# then:
|
|
42
|
+
output_software = triggerflow.software_predict(input_data)
|
|
43
|
+
output_firmware = triggerflow.firmware_predict(input_data)
|
|
44
|
+
output_qonnx = triggerflow.qonnx_predict(input_data)
|
|
45
|
+
|
|
46
|
+
# save and load trigger models:
|
|
47
|
+
triggerflow.save("triggerflow.tar.xz")
|
|
48
|
+
|
|
49
|
+
# in a separate session:
|
|
50
|
+
from triggerflow.core import TriggerModel
|
|
51
|
+
triggerflow = TriggerModel.load("triggerflow.tar.xz")
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Logging with MLflow
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
# logging with MLFlow:
|
|
58
|
+
import mlflow
|
|
59
|
+
from triggerflow.mlflow_wrapper import log_model
|
|
60
|
+
|
|
61
|
+
mlflow.set_tracking_uri("https://ngt.cern.ch/models")
|
|
62
|
+
experiment_id = mlflow.create_experiment("example-experiment")
|
|
63
|
+
|
|
64
|
+
with mlflow.start_run(run_name="trial-v1", experiment_id=experiment_id):
|
|
65
|
+
log_model(triggerflow, registered_model_name="TriggerModel")
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 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`.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
# Creating a kedro pipeline
|
|
72
|
+
|
|
73
|
+
This repository also comes with a default pipeline for trigger models based on kedro.
|
|
74
|
+
One can create a new pipeline via:
|
|
75
|
+
|
|
76
|
+
NOTE: no "-" and upper cases!
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
# Create a conda environment & activate it
|
|
80
|
+
conda create -n triggerflow python=3.11
|
|
81
|
+
conda activate triggerflow
|
|
82
|
+
|
|
83
|
+
# install triggerflow
|
|
84
|
+
pip install triggerflow
|
|
85
|
+
|
|
86
|
+
# Create a pipeline
|
|
87
|
+
triggerflow new demo_pipeline
|
|
88
|
+
|
|
89
|
+
# NOTE: since we dont install dependency one has to create a
|
|
90
|
+
# conda env based on the environment.yml file of the pipeline
|
|
91
|
+
# this file can be changed to the needs of the indiviual project
|
|
92
|
+
cd demo_pipeline
|
|
93
|
+
conda env update -n triggerflow --file environment.yml
|
|
94
|
+
|
|
95
|
+
# Run Kedro
|
|
96
|
+
kedro run
|
|
97
|
+
```
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
trigger_dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
trigger_dataset/core.py,sha256=ZX96U6rWxxfCatDQbst6IRZvtlyDj1_2JA7stPydGTQ,2645
|
|
3
|
+
trigger_loader/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
trigger_loader/cluster_manager.py,sha256=n_HgphyNrNzSsCXOnnV02QMd1mR_HLEdlaBy4ClhIF8,3581
|
|
5
|
+
trigger_loader/loader.py,sha256=pLk4KENBGaviZcRuA-XdMQQiNdNU93KBitXx2YbqM8Q,3112
|
|
6
|
+
trigger_loader/processor.py,sha256=cvBfYmvcr4FLzOHgGE50oy7EkFzFaV80Z_66amqfsEY,7724
|
|
7
|
+
triggerflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
triggerflow/cli.py,sha256=ZNQb3XQN8Ir6Hp6KX_ugec9bm2kqxLNZ0KdVGJmnqFA,4498
|
|
9
|
+
triggerflow/core.py,sha256=_tKIE7IMAyjZi_eeJaCejUNgKbSVJGV0381PBByyNrM,19915
|
|
10
|
+
triggerflow/mlflow_wrapper.py,sha256=yCaIS-H7oC2KxnExj24ka9ylF4A1wgzRIpc7Y43ervI,10667
|
|
11
|
+
triggerflow/starter/.gitignore,sha256=tH2z_M-tPM9MLWC2wPz1Z43Dq-wdVmb_kVYtrLT3tN4,2052
|
|
12
|
+
triggerflow/starter/README.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
|
+
triggerflow/starter/cookiecutter.json,sha256=neplzXvVe3g6OVqYD8M2olfmjRKNr1UKqmflzP3j1UY,259
|
|
14
|
+
triggerflow/starter/prompts.yml,sha256=j-X_5sOsH2nvE1wg9awdNDtkNiZ7QjbvVKs9d9xyMaM,330
|
|
15
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/.dvcignore,sha256=HYBS6WcsRMYtwnpN9zztNW8gy5wY0ae1qgkkkwlglYM,139
|
|
16
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/.gitignore,sha256=tH2z_M-tPM9MLWC2wPz1Z43Dq-wdVmb_kVYtrLT3tN4,2052
|
|
17
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/.gitlab-ci.yml,sha256=lcahT5HExM3JsqXj3u44cNEmrEl-q97JUrGxPMG6jsQ,941
|
|
18
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/README.md,sha256=4t7erte67zY0Cp6qZco04EkXSXk2lb0uFVXaAx0C154,955
|
|
19
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/dvc.yaml,sha256=G9TOE23-awIEt3BmMH66OCN7x04aPqFdsJDC8VbApVg,74
|
|
20
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/environment.yml,sha256=J84BmAfnK_TsW7v_WifTxW9Wc9v0gX_lzmh0-c0zutI,285
|
|
21
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/pyproject.toml,sha256=2maFdFnLln3Q6z8YODT2Wpw-jEi5bKN2yoC-QG3rGVM,1378
|
|
22
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/README.md,sha256=0jCfkFBPK5SqR2wJOKd7XTB9e1yvN0gw4D4Zi3nI8aI,1067
|
|
23
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/logging.yml,sha256=SaMNpZDTQhhuyCV_x6DaW1Vb8BX3WxxcV3euK98XmGg,1038
|
|
24
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/catalog.yml,sha256=Bell27MJvByOdkQmRcOoG0aKAU3hCyiy1ivws1xZcJQ,2397
|
|
25
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters.yml,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_compile.yml,sha256=I88osguJBIfLWyKJcMZg-TOUL-HOVo0sEbro8tTndBI,392
|
|
27
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_data_processing.yml,sha256=YYWXiyHDzRnr2kIMytw_umfEpazLqPDYRG7USSPwLUo,273
|
|
28
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_load_data.yml,sha256=Jol2shPtxOEtVpju9e8xXsWkiuyuvVrdpLC0LSMezbU,235
|
|
29
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_model_training.yml,sha256=l4QPLJ66i73sZ7wT03r6aOFWzhhBIIulsBoMsBVOw-g,335
|
|
30
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/base/parameters_model_validation.yml,sha256=6eBMmMoTJRp0dsTo0Tdjr6Mig3BrrBSlIs_ZN98hyPQ,242
|
|
31
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/catalog.yml,sha256=Bell27MJvByOdkQmRcOoG0aKAU3hCyiy1ivws1xZcJQ,2397
|
|
32
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters.yml,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_compile.yml,sha256=yDB39m9OszZaqX67RgcUcwh37EHGWfJAp_WRblwNFI4,397
|
|
34
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_data_processing.yml,sha256=ABcV4sNpIAwsSkkbTk27wIcE_5QEDpaGix1t34mMvjk,278
|
|
35
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_load_data.yml,sha256=fDn4tpNdgwSl-mC6-nUZP_bykj08eeEAt8XrEfHEuzY,240
|
|
36
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_model_training.yml,sha256=l4QPLJ66i73sZ7wT03r6aOFWzhhBIIulsBoMsBVOw-g,335
|
|
37
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/conf/local/parameters_model_validation.yml,sha256=zroINrWbzGvp1A2TiYdO_bp8LuPav0fIpVa1fbK8dGc,244
|
|
38
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/01_raw/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/01_raw/samples.json,sha256=-gLHehOyK7ziLMRNe2px7f56SlWr3n1du1L6XgdbI5o,375
|
|
40
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/01_raw/samples_dummy.json,sha256=QX17MFlxXOObx5ghl-imT82jVHCojSZKlytO0uw1fJM,707
|
|
41
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/02_loaded/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/03_preprocessed/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/04_models/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/05_validation/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/06_compile/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
46
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/data/07_reporting/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/__init__.py,sha256=a-MTXhipkVaDsY3XW0DVoRSmAxbE4_NRNQo7lT4IqsM,59
|
|
48
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/__main__.py,sha256=YGS0Nx3OcMauvo68ReZhvznjKK_XoEUzLcnTdP1806g,659
|
|
49
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipeline_registry.py,sha256=LZHowiYdVJu2N1I0G2u2l7IcTU44FM8a4u_EAXZBpTk,435
|
|
50
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/settings.py,sha256=TRMhMNzWwELn7LuO3Xswbrcidxb4uP-0-YhvCSgglFg,1648
|
|
51
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/any_object.py,sha256=0y5nOkz17N8rr8b8U053eOQ2DUmPakAhdBfJmvd-npQ,367
|
|
52
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/base_dataset.py,sha256=VZityUPdOigfGrqj9TMT5DtyYpMS5jXfoBmlfRGmF5Q,4972
|
|
53
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/meta_dataset.py,sha256=siI8gyGvIKMd4DCtKm2wJftl5a5zo1HlO5s3WOzLw5U,2785
|
|
54
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/datasets/{{ cookiecutter.python_package }}_dataset.py,sha256=VLj4E7hsxZwswVKxyPCYrCzJ5ZCunSvNyijCWHzrPUo,936
|
|
55
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/models/base_model.py,sha256=PJ1S_1qIk8UyMvoGEY7UiHE7nilE4xrnwWVY9gPRh_k,4788
|
|
57
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/models/{{ cookiecutter.python_package }}_model.py,sha256=VkHps3wrtQcfM-CA_Ic6fsw-VSJv_FZcrSRfIKBJ1Xs,419
|
|
58
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/compile/__init__.py,sha256=X2jAlHHzleo1Pb9hKoh4aHOo3L6BqrnlsAxA4AVBfMM,168
|
|
59
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/compile/nodes.py,sha256=A9_Eoky7BWXTgvEiZUqUUdtX0mrUH7joNOof-en1MH8,1414
|
|
60
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/compile/pipeline.py,sha256=yeWpTxOxSONbF-pUW1bipqSgMLabWIWIe9nVdTkzG0E,207
|
|
61
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/data_processing/__init__.py,sha256=Eflz9--0_L6PipS2SW9vmSKR3g0yZBjxbEnNoZ9bjQM,176
|
|
62
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/data_processing/nodes.py,sha256=bmn-GeSQ54V2Tz5iz9Cb8MnhQXAcDlGecOiWn847su0,1053
|
|
63
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/data_processing/pipeline.py,sha256=PjFIWN0esIMUQ2-b1fz2FZNY7Tbn5tymBW6tF57Tm04,989
|
|
64
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/load_data/__init__.py,sha256=M4_hXNbopG9IGnCLazqQLMT5yjMoNdUbyimcmaIFX0U,175
|
|
65
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/load_data/nodes.py,sha256=so7UHCsivnIT6K2p-Gw9JBuiD_7BQOTRpKJ4eVMtVt8,319
|
|
66
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/load_data/pipeline.py,sha256=f2GVZNZWfKXaeHCJmBnoU4ljJ_wCfIc670z0r2dTSjU,607
|
|
67
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_training/__init__.py,sha256=M4_hXNbopG9IGnCLazqQLMT5yjMoNdUbyimcmaIFX0U,175
|
|
68
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_training/nodes.py,sha256=f38DDVELduNOoJGzHhw8P-XQZ4151B6pee6iDb1WqHM,883
|
|
69
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_training/pipeline.py,sha256=5LIoAo2CQGyeGIvcsSXOXP1CIJqdk_MlKZPfdHo8Ax4,700
|
|
70
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_validation/__init__.py,sha256=uHp2bxK1LF7_NXcftYOb1wb4QU41_cGL_VV2-J18lJw,177
|
|
71
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_validation/nodes.py,sha256=Kk6Fybq-w6EnBB14bdn-MLjbm_eigLlgFn_LVrnplCE,615
|
|
72
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/pipelines/model_validation/pipeline.py,sha256=iUhZhIJ2waEQpCxn6iGEaM28VTtAC47gUww_DkQ-VIo,654
|
|
73
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/utils/metric.py,sha256=nS5PCf2VaLlgl44uqAcz-PraQ3GW53coeVbuG9c19R0,82
|
|
75
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/src/{{ cookiecutter.python_package }}/utils/plotting.py,sha256=YkB8bll9dtRiQ0gIbLDdKR2afG6OYVrFmhLwPP60oJ8,18527
|
|
76
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
77
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/test_run.py,sha256=aGLSgzTBQGKPcezqsMDmxMj3vNZBV7VTaPwpd4XwIrQ,912
|
|
78
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
79
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/compile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
80
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/compile/test_pipeline.py,sha256=bhbQ8Pteov85kD_4rH6oaJFmxoO--zgE5BWBwv7bYog,290
|
|
81
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/data_processing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
82
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/data_processing/test_pipeline.py,sha256=LhrGZ619rDs3Mr2wsR6iysATVYj9pSBrsBJZrtlhGUg,298
|
|
83
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/load_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
84
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/load_data/test_pipeline.py,sha256=BlPsVwdspuEuQwvyVcPztAQFN6aSo1Z0Y1WK4BBJbhk,292
|
|
85
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_training/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_training/test_pipeline.py,sha256=0N747l50lEmjAgCy9K8LrNMW436edMUMo1E7tS4MADY,297
|
|
87
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_validation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
88
|
+
triggerflow/starter/{{ cookiecutter.repo_name }}/tests/pipelines/model_validation/test_pipeline.py,sha256=2BTupcyuFEXTyMrGLVmF6Yv0CAZcdedc7fxEfmLGmxo,299
|
|
89
|
+
triggerflow/templates/makefile,sha256=VL39isTUBewrs8zTSDzdP6LLln7zpGoCZnLadpMu7CA,808
|
|
90
|
+
triggerflow/templates/makefile_version,sha256=Tmu0tyAopJbiBQVMMOa6l2Cz5GkEn20mwgzIi0CfhyM,338
|
|
91
|
+
triggerflow/templates/model_template.cpp,sha256=eGwY5ca_HgjoIvqorOBPSJspP0wngpjJheq3meb48r4,1616
|
|
92
|
+
triggerflow/templates/scales.h,sha256=5bq6lVF36SRQKE2zg9RpBG6K5orpPlnJ8g125nbtFow,365
|
|
93
|
+
triggerflow-0.2.dist-info/METADATA,sha256=U7gMurk10TaNU2Hygafy7KDqMvqevhhbS10vSEy9zOs,2919
|
|
94
|
+
triggerflow-0.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
95
|
+
triggerflow-0.2.dist-info/entry_points.txt,sha256=5QSV9YDseB_FqgVh9q10BdL4b1I6t68rGwPLXgVL60g,53
|
|
96
|
+
triggerflow-0.2.dist-info/top_level.txt,sha256=cX0jkuM9tfxGp002ZBQ1AYgx-6D_NgBtomgPL0WA9bE,43
|
|
97
|
+
triggerflow-0.2.dist-info/RECORD,,
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: triggerflow
|
|
3
|
-
Version: 0.1.11
|
|
4
|
-
Summary: Utilities for ML models targeting hardware triggers
|
|
5
|
-
Classifier: Programming Language :: Python :: 3
|
|
6
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
7
|
-
Classifier: Operating System :: OS Independent
|
|
8
|
-
Requires-Python: >=3.11
|
|
9
|
-
Description-Content-Type: text/markdown
|
|
10
|
-
Requires-Dist: mlflow>=2.0
|
|
11
|
-
|
|
12
|
-
# Machine Learning for Hardware Triggers
|
|
13
|
-
|
|
14
|
-
`triggerflow` provides a set of utilities for Machine Learning models targeting FPGA deployment.
|
|
15
|
-
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.
|
|
16
|
-
|
|
17
|
-
## Installation
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
pip install triggerflow
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Usage
|
|
24
|
-
|
|
25
|
-
```python
|
|
26
|
-
|
|
27
|
-
from triggerflow.core import TriggerModel
|
|
28
|
-
|
|
29
|
-
trigger_model = TriggerModel(name="my-trigger-model", ml_backend="Keras", compiler="hls4ml", model, compiler_config or None)
|
|
30
|
-
trigger_model() # call the constructor
|
|
31
|
-
|
|
32
|
-
# then:
|
|
33
|
-
output_software = trigger_model.software_predict(input_data)
|
|
34
|
-
output_firmware = trigger_model.firmware_predict(input_data)
|
|
35
|
-
output_qonnx = trigger_model.qonnx_predict(input_data)
|
|
36
|
-
|
|
37
|
-
# save and load trigger models:
|
|
38
|
-
trigger_model.save("trigger_model.tar.xz")
|
|
39
|
-
|
|
40
|
-
# in a separate session:
|
|
41
|
-
from trigger_model.core import TriggerModel
|
|
42
|
-
trigger_model = TriggerModel.load("trigger_model.tar.xz")
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
## Logging with MLflow
|
|
46
|
-
|
|
47
|
-
```python
|
|
48
|
-
# logging with MLFlow:
|
|
49
|
-
import mlflow
|
|
50
|
-
from trigger_model.mlflow_wrapper import log_model
|
|
51
|
-
|
|
52
|
-
mlflow.set_tracking_uri("https://ngt.cern.ch/models")
|
|
53
|
-
experiment_id = mlflow.create_experiment("example-experiment")
|
|
54
|
-
|
|
55
|
-
with mlflow.start_run(run_name="trial-v1", experiment_id=experiment_id):
|
|
56
|
-
log_model(trigger_model, registered_model_name="TriggerModel")
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### 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`.
|
|
60
|
-
|
|
61
|
-
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
triggerflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
triggerflow/core.py,sha256=xf-jXhTChnJfanZWuIdqHzDeOm_nQl7E1NIDOn5yplE,20546
|
|
3
|
-
triggerflow/mlflow_wrapper.py,sha256=mT15nSvMGqY9Wxq_L6tyNjGQ0Wy0wjn6hmuk3v43HWs,10692
|
|
4
|
-
triggerflow/templates/makefile,sha256=VL39isTUBewrs8zTSDzdP6LLln7zpGoCZnLadpMu7CA,808
|
|
5
|
-
triggerflow/templates/makefile_version,sha256=Tmu0tyAopJbiBQVMMOa6l2Cz5GkEn20mwgzIi0CfhyM,338
|
|
6
|
-
triggerflow/templates/model_template.cpp,sha256=eGwY5ca_HgjoIvqorOBPSJspP0wngpjJheq3meb48r4,1616
|
|
7
|
-
triggerflow/templates/scales.h,sha256=5bq6lVF36SRQKE2zg9RpBG6K5orpPlnJ8g125nbtFow,365
|
|
8
|
-
triggerflow-0.1.11.dist-info/METADATA,sha256=07alh7WTRzNRKEbxXmJHc0g6ABevkjiyPR5FeFX5OLg,1943
|
|
9
|
-
triggerflow-0.1.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
triggerflow-0.1.11.dist-info/top_level.txt,sha256=g4M0nqpVPFZcmVmsoLExDtJFLDBK4fzobCIBqo13BEw,12
|
|
11
|
-
triggerflow-0.1.11.dist-info/RECORD,,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
triggerflow
|
|
File without changes
|