From 6016c2ff62c121d07634ec0ca81ca9a019ccf03c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 25 Oct 2021 09:39:11 +0200 Subject: model: Set DFATOOL_DTREE_ENABLED=0 to disable dtree support --- README.md | 1 + lib/model.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 72ce2dd..5f9e719 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,4 @@ The following variables may be set to alter the behaviour of dfatool components. | `DFATOOL_KCONF_WITH_CHOICE_NODES` | 0, **1** | Treat kconfig choices (e.g. "choice Model → MobileNet / ResNet / Inception") as enum parameters. If enabled, the corresponding boolean kconfig variables (e.g. "Model\_MobileNet") are not converted to parameters. If disabled, all (and only) boolean kconfig variables are treated as parameters. Mostly relevant for analyze-kconfig, eval-kconfig | | `DFATOOL_COMPENSATE_DRIFT` | **0**, 1 | Perform drift compensation for loaders without sync input (e.g. EnergyTrace or Keysight) | | `DFATOOL_DRIFT_COMPENSATION_PENALTY` | 0 .. 100 (default: majority vote over several penalties) | Specify penalty for ruptures.py PELT changepoint petection | +| `DFATOOL_DTREE_ENABLED` | 0, **1** | Use decision trees in get\_fitted diff --git a/lib/model.py b/lib/model.py index 06ff25c..844ec89 100644 --- a/lib/model.py +++ b/lib/model.py @@ -248,6 +248,7 @@ class AnalyticModel: if not self.fit_done: paramfit = ParamFit() + tree_allowed = bool(int(os.getenv("DFATOOL_DTREE_ENABLED", "1"))) tree_required = dict() for name in self.names: @@ -264,7 +265,7 @@ class AnalyticModel: safe_functions_enabled=safe_functions_enabled ): paramfit.enqueue(key, param, args, kwargs) - else: + elif tree_allowed: tree_required[name][attr] = self.attr_by_name[name][ attr ].depends_on_any_param() -- cgit v1.2.3