From 4505a47499d8131733528733a289c9a65da0d8ed Mon Sep 17 00:00:00 2001 From: Aadyot Bhatnagar Date: Fri, 3 Jun 2022 15:51:39 -0700 Subject: [PATCH] Declare class fields for DetectorConfig. (#99) Previously, the instance fields `enable_threshold` and `enable_calibrator` were not declared at the class level. This made them inaccessible when instantiating layered models. This commit fixes the issue. --- merlion/models/anomaly/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/merlion/models/anomaly/base.py b/merlion/models/anomaly/base.py index ce4b76769..d447b69f3 100644 --- a/merlion/models/anomaly/base.py +++ b/merlion/models/anomaly/base.py @@ -35,6 +35,8 @@ class DetectorConfig(Config): _default_threshold = AggregateAlarms(alm_threshold=3.0) calibrator: AnomScoreCalibrator = None threshold: Threshold = None + enable_calibrator: bool = True + enable_threshold: bool = True def __init__( self, max_score: float = 1000, threshold=None, enable_calibrator=True, enable_threshold=True, **kwargs