summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2021-10-25 09:39:11 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2021-10-25 09:39:32 +0200
commit6016c2ff62c121d07634ec0ca81ca9a019ccf03c (patch)
tree0027974817e48e901a79f2ea336b6a11c2aa723c
parentca17ae90c4fe49e578d010671cebb699b3d8a550 (diff)
model: Set DFATOOL_DTREE_ENABLED=0 to disable dtree support
-rw-r--r--README.md1
-rw-r--r--lib/model.py3
2 files changed, 3 insertions, 1 deletions
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()