autogluon.multimodal 1.1.2b20241111__py3-none-any.whl → 1.1.2b20241113__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- autogluon/multimodal/constants.py +17 -0
- autogluon/multimodal/problem_types.py +18 -27
- autogluon/multimodal/utils/metric.py +16 -9
- autogluon/multimodal/version.py +1 -1
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/METADATA +4 -4
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/RECORD +13 -13
- /autogluon.multimodal-1.1.2b20241111-py3.8-nspkg.pth → /autogluon.multimodal-1.1.2b20241113-py3.8-nspkg.pth +0 -0
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/LICENSE +0 -0
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/NOTICE +0 -0
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/WHEEL +0 -0
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/namespace_packages.txt +0 -0
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/top_level.txt +0 -0
- {autogluon.multimodal-1.1.2b20241111.dist-info → autogluon.multimodal-1.1.2b20241113.dist-info}/zip-safe +0 -0
@@ -177,6 +177,23 @@ MATCHING_METRICS = {
|
|
177
177
|
}
|
178
178
|
MATCHING_METRICS_WITHOUT_PROBLEM_TYPE = [RECALL, NDCG]
|
179
179
|
|
180
|
+
EVALUATION_METRICS = {
|
181
|
+
# Use evaluation metrics from METRICS for these types
|
182
|
+
BINARY: METRICS[BINARY].keys(),
|
183
|
+
MULTICLASS: METRICS[MULTICLASS].keys(),
|
184
|
+
REGRESSION: METRICS[REGRESSION].keys(),
|
185
|
+
OBJECT_DETECTION: DETECTION_METRICS,
|
186
|
+
SEMANTIC_SEGMENTATION: [IOU, BER, SM],
|
187
|
+
NER: [OVERALL_F1, NER_TOKEN_F1],
|
188
|
+
NAMED_ENTITY_RECOGNITION: [OVERALL_F1, NER_TOKEN_F1],
|
189
|
+
FEW_SHOT_CLASSIFICATION: METRICS[MULTICLASS].keys(),
|
190
|
+
}
|
191
|
+
|
192
|
+
VALIDATION_METRICS = {
|
193
|
+
problem_type: [metric for metric in metrics if metric in METRIC_MODE_MAP] + [DIRECT_LOSS]
|
194
|
+
for problem_type, metrics in EVALUATION_METRICS.items()
|
195
|
+
}
|
196
|
+
|
180
197
|
# Training status
|
181
198
|
TRAIN = "train"
|
182
199
|
VALIDATE = "validate"
|
@@ -3,16 +3,12 @@
|
|
3
3
|
from dataclasses import dataclass, field
|
4
4
|
from typing import List, Optional, Set
|
5
5
|
|
6
|
-
from autogluon.core.metrics import METRICS
|
7
|
-
|
8
6
|
from .constants import (
|
9
7
|
ACCURACY,
|
10
|
-
BER,
|
11
8
|
BINARY,
|
12
9
|
CATEGORICAL,
|
13
10
|
CLASSIFICATION,
|
14
|
-
|
15
|
-
DIRECT_LOSS,
|
11
|
+
EVALUATION_METRICS,
|
16
12
|
FEATURE_EXTRACTION,
|
17
13
|
FEW_SHOT_CLASSIFICATION,
|
18
14
|
IMAGE,
|
@@ -22,7 +18,6 @@ from .constants import (
|
|
22
18
|
IMAGE_TEXT_SIMILARITY,
|
23
19
|
IOU,
|
24
20
|
MAP,
|
25
|
-
METRIC_MODE_MAP,
|
26
21
|
MULTICLASS,
|
27
22
|
NAMED_ENTITY_RECOGNITION,
|
28
23
|
NER,
|
@@ -30,16 +25,15 @@ from .constants import (
|
|
30
25
|
NER_TOKEN_F1,
|
31
26
|
NUMERICAL,
|
32
27
|
OBJECT_DETECTION,
|
33
|
-
OVERALL_F1,
|
34
28
|
REGRESSION,
|
35
29
|
RMSE,
|
36
30
|
ROC_AUC,
|
37
31
|
ROIS,
|
38
32
|
SEMANTIC_SEGMENTATION,
|
39
|
-
SM,
|
40
33
|
TEXT,
|
41
34
|
TEXT_NER,
|
42
35
|
TEXT_SIMILARITY,
|
36
|
+
VALIDATION_METRICS,
|
43
37
|
ZERO_SHOT_IMAGE_CLASSIFICATION,
|
44
38
|
)
|
45
39
|
from .registry import Registry
|
@@ -76,11 +70,10 @@ class ProblemTypeProperty:
|
|
76
70
|
# The fallback label type of the problem
|
77
71
|
_fallback_label_type: Optional[str] = None
|
78
72
|
|
79
|
-
#
|
80
|
-
|
81
|
-
_supported_evaluation_metrics: Optional[List[str]] = None
|
73
|
+
# If evaluations are supported
|
74
|
+
_support_eval: Optional[bool] = False
|
82
75
|
|
83
|
-
# Overwrite the default setting (first in
|
76
|
+
# Overwrite the default setting (first in supported_evaluation_metrics)
|
84
77
|
_fallback_evaluation_metric: Optional[str] = None
|
85
78
|
|
86
79
|
# The validation metric fallback
|
@@ -96,8 +89,8 @@ class ProblemTypeProperty:
|
|
96
89
|
|
97
90
|
@property
|
98
91
|
def supported_evaluation_metrics(self):
|
99
|
-
if self.
|
100
|
-
return self.
|
92
|
+
if self._support_eval:
|
93
|
+
return EVALUATION_METRICS[self.name]
|
101
94
|
else:
|
102
95
|
return []
|
103
96
|
|
@@ -105,17 +98,15 @@ class ProblemTypeProperty:
|
|
105
98
|
def fallback_evaluation_metric(self):
|
106
99
|
if self._fallback_evaluation_metric:
|
107
100
|
return self._fallback_evaluation_metric
|
108
|
-
elif self.
|
109
|
-
return self.
|
101
|
+
elif self._support_eval:
|
102
|
+
return self.supported_evaluation_metrics[0]
|
110
103
|
else:
|
111
104
|
return None
|
112
105
|
|
113
106
|
@property
|
114
107
|
def supported_validation_metrics(self):
|
115
|
-
if self.
|
116
|
-
return [
|
117
|
-
DIRECT_LOSS
|
118
|
-
]
|
108
|
+
if self._support_eval:
|
109
|
+
return VALIDATION_METRICS[self.name]
|
119
110
|
else:
|
120
111
|
return []
|
121
112
|
|
@@ -145,7 +136,7 @@ PROBLEM_TYPES_REG.register(
|
|
145
136
|
supported_modality_type={IMAGE, IMAGE_BYTEARRAY, IMAGE_BASE64_STR, TEXT, CATEGORICAL, NUMERICAL},
|
146
137
|
supported_label_type={CATEGORICAL},
|
147
138
|
is_classification=True,
|
148
|
-
|
139
|
+
_support_eval=True,
|
149
140
|
_fallback_evaluation_metric=ROC_AUC,
|
150
141
|
_fallback_validation_metric=ROC_AUC,
|
151
142
|
),
|
@@ -157,7 +148,7 @@ PROBLEM_TYPES_REG.register(
|
|
157
148
|
supported_modality_type={IMAGE, IMAGE_BYTEARRAY, IMAGE_BASE64_STR, TEXT, CATEGORICAL, NUMERICAL},
|
158
149
|
supported_label_type={CATEGORICAL},
|
159
150
|
is_classification=True,
|
160
|
-
|
151
|
+
_support_eval=True,
|
161
152
|
_fallback_evaluation_metric=ACCURACY,
|
162
153
|
_fallback_validation_metric=ACCURACY,
|
163
154
|
),
|
@@ -170,7 +161,7 @@ PROBLEM_TYPES_REG.register(
|
|
170
161
|
name=REGRESSION,
|
171
162
|
supported_modality_type={IMAGE, IMAGE_BYTEARRAY, IMAGE_BASE64_STR, TEXT, CATEGORICAL, NUMERICAL},
|
172
163
|
supported_label_type={NUMERICAL},
|
173
|
-
|
164
|
+
_support_eval=True,
|
174
165
|
_fallback_evaluation_metric=RMSE,
|
175
166
|
_fallback_validation_metric=RMSE,
|
176
167
|
),
|
@@ -185,7 +176,7 @@ PROBLEM_TYPES_REG.register(
|
|
185
176
|
supported_modality_type={IMAGE},
|
186
177
|
supported_label_type={ROIS},
|
187
178
|
force_exist_modality={IMAGE},
|
188
|
-
|
179
|
+
_support_eval=True,
|
189
180
|
_fallback_validation_metric=MAP,
|
190
181
|
),
|
191
182
|
)
|
@@ -200,7 +191,7 @@ PROBLEM_TYPES_REG.register(
|
|
200
191
|
supported_modality_type={IMAGE},
|
201
192
|
supported_label_type={IMAGE},
|
202
193
|
force_exist_modality={IMAGE},
|
203
|
-
|
194
|
+
_support_eval=True,
|
204
195
|
_fallback_evaluation_metric=IOU,
|
205
196
|
_fallback_validation_metric=IOU,
|
206
197
|
),
|
@@ -247,7 +238,7 @@ _ner_property = ProblemTypeProperty(
|
|
247
238
|
supported_modality_type={IMAGE, TEXT, CATEGORICAL, NUMERICAL, TEXT_NER},
|
248
239
|
supported_label_type={NER_ANNOTATION},
|
249
240
|
force_exist_modality={TEXT_NER},
|
250
|
-
|
241
|
+
_support_eval=True,
|
251
242
|
_fallback_validation_metric=NER_TOKEN_F1,
|
252
243
|
)
|
253
244
|
PROBLEM_TYPES_REG.register(NER, _ner_property)
|
@@ -281,7 +272,7 @@ PROBLEM_TYPES_REG.register(
|
|
281
272
|
support_zero_shot=False,
|
282
273
|
supported_modality_type={IMAGE, TEXT},
|
283
274
|
supported_label_type={CATEGORICAL},
|
284
|
-
|
275
|
+
_support_eval=True,
|
285
276
|
_fallback_evaluation_metric=ACCURACY,
|
286
277
|
_fallback_validation_metric=ACCURACY,
|
287
278
|
),
|
@@ -8,7 +8,7 @@ import evaluate
|
|
8
8
|
import numpy as np
|
9
9
|
from sklearn.metrics import f1_score
|
10
10
|
|
11
|
-
from autogluon.core.metrics import Scorer, get_metric
|
11
|
+
from autogluon.core.metrics import Scorer, compute_metric, get_metric
|
12
12
|
|
13
13
|
from ..constants import (
|
14
14
|
ACCURACY,
|
@@ -231,15 +231,22 @@ def compute_score(
|
|
231
231
|
return metric.compute(references=metric_data[Y_TRUE], predictions=metric_data[Y_PRED])
|
232
232
|
|
233
233
|
metric = get_metric(metric)
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
return
|
234
|
+
|
235
|
+
y = metric_data[Y_TRUE]
|
236
|
+
if metric.needs_proba or metric.needs_threshold:
|
237
|
+
return metric.convert_score_to_original(
|
238
|
+
compute_metric(y=y, y_pred_proba=metric_data[Y_PRED_PROB][:, pos_label], metric=metric, weights=None)
|
239
|
+
)
|
238
240
|
else:
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
241
|
+
y_pred = metric_data[Y_PRED]
|
242
|
+
|
243
|
+
# TODO: This is a hack. Doesn't support `f1_macro`, `f1_micro`, `f1_weighted`, or custom `f1` metrics with different names.
|
244
|
+
# TODO: Longterm the solution should be to have the input data to this function use the internal representation without the original class names. This way `pos_label` would not need to be specified.
|
245
|
+
if metric.name == F1: # only for binary classification
|
246
|
+
y = (metric_data[Y_TRUE] == pos_label).astype(int)
|
247
|
+
y_pred = (metric_data[Y_PRED] == pos_label).astype(int)
|
248
|
+
|
249
|
+
return metric.convert_score_to_original(compute_metric(y=y, y_pred=y_pred, metric=metric, weights=None))
|
243
250
|
|
244
251
|
|
245
252
|
class RankingMetrics:
|
autogluon/multimodal/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: autogluon.multimodal
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.2b20241113
|
4
4
|
Summary: Fast and Accurate ML in 3 Lines of Code
|
5
5
|
Home-page: https://github.com/autogluon/autogluon
|
6
6
|
Author: AutoGluon Community
|
@@ -56,9 +56,9 @@ Requires-Dist: text-unidecode<1.4,>=1.3
|
|
56
56
|
Requires-Dist: torchmetrics<1.3.0,>=1.2.0
|
57
57
|
Requires-Dist: nptyping<2.5.0,>=1.4.4
|
58
58
|
Requires-Dist: omegaconf<2.3.0,>=2.1.1
|
59
|
-
Requires-Dist: autogluon.core[raytune]==1.1.
|
60
|
-
Requires-Dist: autogluon.features==1.1.
|
61
|
-
Requires-Dist: autogluon.common==1.1.
|
59
|
+
Requires-Dist: autogluon.core[raytune]==1.1.2b20241113
|
60
|
+
Requires-Dist: autogluon.features==1.1.2b20241113
|
61
|
+
Requires-Dist: autogluon.common==1.1.2b20241113
|
62
62
|
Requires-Dist: pytorch-metric-learning<2.4,>=1.3.0
|
63
63
|
Requires-Dist: nlpaug<1.2.0,>=1.1.10
|
64
64
|
Requires-Dist: nltk<3.9,>=3.4.5
|
@@ -1,11 +1,11 @@
|
|
1
|
-
autogluon.multimodal-1.1.
|
1
|
+
autogluon.multimodal-1.1.2b20241113-py3.8-nspkg.pth,sha256=cQGwpuGPqg1GXscIwt-7PmME1OnSpD-7ixkikJ31WAY,554
|
2
2
|
autogluon/multimodal/__init__.py,sha256=EuWb-QmtFBKePJw4_4Kpp9dKrabv121haYw_Oiu2jfI,238
|
3
|
-
autogluon/multimodal/constants.py,sha256=
|
3
|
+
autogluon/multimodal/constants.py,sha256=8IDFqC45Sz3fD0VO2wpzj5Ino387yMAvmKMt-QRhzK0,9122
|
4
4
|
autogluon/multimodal/predictor.py,sha256=beV2gOcTnviYtU8UWTWdqWYTbuk5sC6Sba-pAEaFQyg,40936
|
5
5
|
autogluon/multimodal/presets.py,sha256=VR_arn7X4eiQcGcvJVmwxDopPJGvYP1W1cBZ2AOcdJM,25882
|
6
|
-
autogluon/multimodal/problem_types.py,sha256=
|
6
|
+
autogluon/multimodal/problem_types.py,sha256=H0q2V--d_KH7YL_AxMrs77SHR5SBVLDsdie9F2Uu1kM,8627
|
7
7
|
autogluon/multimodal/registry.py,sha256=vqvONWweZP44aBo1jCvlqLdL0Agn2kyTK8uXUwagZhs,3670
|
8
|
-
autogluon/multimodal/version.py,sha256=
|
8
|
+
autogluon/multimodal/version.py,sha256=OGArr6c4pNSqH_iw-M1qDHQMDvnxMN7HervCqm8kQw8,90
|
9
9
|
autogluon/multimodal/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
10
10
|
autogluon/multimodal/cli/prepare_detection_dataset.py,sha256=9NCYmCUMPRWbxxbN_C7YQjMYlrAm8gbwJ3Qd-79JWH4,5218
|
11
11
|
autogluon/multimodal/cli/voc2coco.py,sha256=LXVu9RIfOZs_1URrzO-_3Nrvb9uGEgPxCY4-B6m1coc,9605
|
@@ -126,7 +126,7 @@ autogluon/multimodal/utils/label_studio.py,sha256=7lFl75zztIy6VCuCbyZkN-BLbtr0j1
|
|
126
126
|
autogluon/multimodal/utils/load.py,sha256=rzfADn6obbZL20QZc034IPhIiza7SA8f5MPpd9hPsAE,5106
|
127
127
|
autogluon/multimodal/utils/log.py,sha256=KbVrP5GmQya0e-1YlgdD5EnsUJDGhC7Q3L8eup62KDs,5908
|
128
128
|
autogluon/multimodal/utils/matcher.py,sha256=PRtm5LCIXK_L6Qy0WAgMURUYL7M-DTpn9fCFYsCd2OA,18198
|
129
|
-
autogluon/multimodal/utils/metric.py,sha256=
|
129
|
+
autogluon/multimodal/utils/metric.py,sha256=EGlpCwUe5KF9gQ9CPcwDVE5bCgR_oW2r1n4sXdLYXAA,16714
|
130
130
|
autogluon/multimodal/utils/misc.py,sha256=WaDWN-6xCCL4tCkxMr4VMb5oiNmmBLrWo5FC3bCQp2A,4772
|
131
131
|
autogluon/multimodal/utils/mmcv.py,sha256=Jjg5PiPqiRNJk6yWkQQlNiqT7qhStN94QjqQsZO3uVw,922
|
132
132
|
autogluon/multimodal/utils/model.py,sha256=Z_9bev8nRk92cUZjPggVAM3R3CHFlecU-YzjkMGPUsE,21963
|
@@ -135,11 +135,11 @@ autogluon/multimodal/utils/object_detection.py,sha256=fHZxon5LoYRmNu_7jm_pDjesVx
|
|
135
135
|
autogluon/multimodal/utils/onnx.py,sha256=rblWnphKTsfbosbieJu8PsH6SMDw4on9BS8bR1plL2U,5607
|
136
136
|
autogluon/multimodal/utils/save.py,sha256=zYIO3mYMGBvHfZcmCUaLpsQa14nVq1LPv2F76uaz89w,3951
|
137
137
|
autogluon/multimodal/utils/visualizer.py,sha256=qAc4_36r3MBDPq1R1jBeb_gcfzIrsylL1S31sRf3wuw,22562
|
138
|
-
autogluon.multimodal-1.1.
|
139
|
-
autogluon.multimodal-1.1.
|
140
|
-
autogluon.multimodal-1.1.
|
141
|
-
autogluon.multimodal-1.1.
|
142
|
-
autogluon.multimodal-1.1.
|
143
|
-
autogluon.multimodal-1.1.
|
144
|
-
autogluon.multimodal-1.1.
|
145
|
-
autogluon.multimodal-1.1.
|
138
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
|
139
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/METADATA,sha256=uQzSe85glheqQXVYS_syaHB8NZ-FUn1ZYE018fBa3Jg,12880
|
140
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/NOTICE,sha256=7nPQuj8Kp-uXsU0S5so3-2dNU5EctS5hDXvvzzehd7E,114
|
141
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/WHEEL,sha256=bFJAMchF8aTQGUgMZzHJyDDMPTO3ToJ7x23SLJa1SVo,92
|
142
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/namespace_packages.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
|
143
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/top_level.txt,sha256=giERA4R78OkJf2ijn5slgjURlhRPzfLr7waIcGkzYAo,10
|
144
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
145
|
+
autogluon.multimodal-1.1.2b20241113.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|