Refactor detector to allow for different standardizations of input features
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tái cấu trúc
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- machine-learning
Hướng nghiên cứu
Start by reading the Detector class and the feature standardization code it currently uses; the issue does not name files or tests. Work out how detector configurations are defined and review the discussion in #558 for context. Done means detectors can select per-feature standardizers and their constructor arguments through configuration, with validation and tests covering the behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Is your feature request related to a problem? Please describe.
Currently we are restricted to create a new detector class if we want to experiment with different standardization of input features. While it currently isn't an issue, we could easily in the future experience a large increase in detectors which for the most part are completely identical, except they do slightly different standardization.
Describe the solution you'd like
If we refactor the Detector class to contain include a class member containing the available features, and then for each feature we provide an instantiated FeatureStandardizer module, which handles the standardization of the given input feature. The classes would then look something like this:
class Detector(Model):
@property
@abstractmethod
def all_features(self):
"""Returns container (List/Tuple) containing all supported features by the detector."""
def __init__(self, used_features: List[str] | Tuple[str], transformations: List[FeatureStandardizer] | Tuple[FeatureStandardizer]):
if not (len(used_features) == len(transformations)):
raise ValueError("Length of used_features and transformations must be identical")
for feature in used_features:
if feature not in self.all_features:
raise ValueError(f"{feature} not a recognized feature for this detector. Recognized features are {self.all_features}")
self.used_features = used_features # features used
self.transformations = transformations # transformations used each index corresponds to the index in used
self.feature_map = {
feature: transformation for feature, transformation in zip(used_features, transformations)
}
def forward(self, x):
"""Applies the correct transformation from feature map to each feature in x, possibly also removes redundant feature, if not already done."""
...
class FeatureStandardizer(Model):
@abstractmethod
def forward(self, x):
"""Applies the given standardization procedure.
x: Contains only the correct feature. Applying the correct FeatureStandardizer to each feature should be taken care of in Detector"""
class LinearStandardizer(FeatureStandardizer):
def __init__(self, offset, scale):
self._offset = offset
self._scale = scale
def forward(self, x):
return (x - self._offset) / self._scale
I'm not well versed enough in config files, to know exactly how those should be made, but they should contain information about which FeatureStandardizers is used for each feature, and the arguments passed to the constructor for the given FeatureStandardizer.
Describe alternatives you've considered
In the constructor for the detector, one could also pass the feature map directly. The transformations might not be needed to save internally in the Detector either, but I think keeping the used_features is beneficial.
Additional context
This feature request is inspired by comments from #558
- Ngôn ngữ chính
- Python
- Star
- 117
- Fork
- 115
- Merge trung bình
- 2 ngày 21 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của graphnet-team/graphnet
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
graphnet-team/graphnet#933 ·
-
Spring cleanĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
graphnet-team/graphnet#927 · 1 bình luận ·
-
Time for a new version release v1.8.1Có thể làm lại được @Aske-Rosted đã nhận 75 ngày trước và không có pull request nào đang mở. Đang mởdecision
graphnet-team/graphnet#924 · 1 người được giao ·
-
Make kaggle checkpoints part of the CICó thể làm lại được @sevmag đã nhận 75 ngày trước và không có pull request nào đang mở. Đang mởbug
graphnet-team/graphnet#921 · 2 bình luận · 1 người được giao ·
-
decision deferred
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
graphnet-team/graphnet#919 ·
Tất cả issue của graphnet-team/graphnet
Issue tương tự
-
MarkdownDocSerializer.post_process escapes '\<' to '\<', rendering literal '<' in CommonMarkĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
docling-project/docling-core#1067 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
correction metadata
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
acl-org/acl-anthology#11101 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] crewai tool create/install/login exit 0 when they failCó thể đã có người làm @Kiko0301 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
vllm-project/compressed-tensors#1033 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
chore kaizen ui-rewrite
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
IBM/mcp-context-forge#7681 ·
Maintainer thường phản hồi trong vòng 2 ngày