-
Notifications
You must be signed in to change notification settings - Fork 640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🚚 Thresholding refactor #1064
🚚 Thresholding refactor #1064
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ashwinvaidya17. Looking good to me.
A question though. Can we make it backward compatible? up until v1, I feel we should support backward compatibility. Otherwise, we'll break this again, which would be annoying.
Would it be possible to check threshold
in config
? For example, if there is method
key we could instantiate AdaptiveScoreThreshold
under the hood, no?
image_threshold_class = image_threshold_config.get("class_path", None) if image_threshold_config else None | ||
image_threshold_args = image_threshold_config.get("init_args", None) if image_threshold_config else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a bit more verbose, but more accurate?
image_threshold_class = image_threshold_config.get("class_path", None) if image_threshold_config else None | |
image_threshold_args = image_threshold_config.get("init_args", None) if image_threshold_config else None | |
image_threshold_class_path = image_threshold_config.get("class_path", None) if image_threshold_config else None | |
image_threshold_init_args = image_threshold_config.get("init_args", None) if image_threshold_config else None |
pixel_threshold_class = pixel_threshold_config.get("class_path", None) if pixel_threshold_config else None | ||
pixel_threshold_args = pixel_threshold_config.get("init_args", None) if pixel_threshold_config else None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above?
raise NotImplementedError("Subclass of BaseAnomalyScoreThreshold must implement the update method") | ||
|
||
def state_dict( | ||
self, destination: Dict[str, Any], prefix: str = "", keep_vars: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self, destination: Dict[str, Any], prefix: str = "", keep_vars: bool = False | |
self, destination: dict[str, Any], prefix: str = "", keep_vars: bool = False |
|
||
def state_dict( | ||
self, destination: Dict[str, Any], prefix: str = "", keep_vars: bool = False | ||
) -> Dict[str, Any] | None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) -> Dict[str, Any] | None: | |
) -> dict[str, Any] | None: |
from __future__ import annotations | ||
|
||
from abc import ABC | ||
from typing import Any, Dict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from typing import Any, Dict | |
from typing import Any |
Closing as these changes are mirrored in a PR to custom loops |
Description
Changes
Checklist