Skip to content

Commit

Permalink
Declare class fields for DetectorConfig. (#99)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aadyotb committed Jun 3, 2022
1 parent 80ba574 commit 4505a47
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions merlion/models/anomaly/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4505a47

Please sign in to comment.