File tree 5 files changed +834
-374
lines changed
5 files changed +834
-374
lines changed Original file line number Diff line number Diff line change 79
79
80
80
MODEL_GARDEN_ICN_MODEL_TYPES = {
81
81
"EFFICIENTNET" ,
82
+ "MAXVIT" ,
82
83
"VIT" ,
83
84
"COCA" ,
84
85
}
85
86
86
87
MODEL_GARDEN_IOD_MODEL_TYPES = {
87
88
"SPINENET" ,
89
+ "YOLO" ,
88
90
}
89
91
90
92
# TODO(b/177079208): Use EPCL Enums for validating Model Types
Original file line number Diff line number Diff line change 22
22
23
23
from google .cloud .aiplatform .compat .types import study as gca_study_compat
24
24
25
+ SEARCH_ALGORITHM_TO_PROTO_VALUE = {
26
+ "random" : gca_study_compat .StudySpec .Algorithm .RANDOM_SEARCH ,
27
+ "grid" : gca_study_compat .StudySpec .Algorithm .GRID_SEARCH ,
28
+ None : gca_study_compat .StudySpec .Algorithm .ALGORITHM_UNSPECIFIED ,
29
+ }
30
+
31
+ MEASUREMENT_SELECTION_TO_PROTO_VALUE = {
32
+ "best" : (gca_study_compat .StudySpec .MeasurementSelectionType .BEST_MEASUREMENT ),
33
+ "last" : (gca_study_compat .StudySpec .MeasurementSelectionType .LAST_MEASUREMENT ),
34
+ None : (
35
+ gca_study_compat .StudySpec .MeasurementSelectionType .MEASUREMENT_SELECTION_TYPE_UNSPECIFIED
36
+ ),
37
+ }
38
+
25
39
_SCALE_TYPE_MAP = {
26
40
"linear" : gca_study_compat .StudySpec .ParameterSpec .ScaleType .UNIT_LINEAR_SCALE ,
27
41
"log" : gca_study_compat .StudySpec .ParameterSpec .ScaleType .UNIT_LOG_SCALE ,
Original file line number Diff line number Diff line change @@ -1998,18 +1998,6 @@ def job_spec(self):
1998
1998
return self ._gca_resource .job_spec
1999
1999
2000
2000
2001
- _SEARCH_ALGORITHM_TO_PROTO_VALUE = {
2002
- "random" : gca_study_compat .StudySpec .Algorithm .RANDOM_SEARCH ,
2003
- "grid" : gca_study_compat .StudySpec .Algorithm .GRID_SEARCH ,
2004
- None : gca_study_compat .StudySpec .Algorithm .ALGORITHM_UNSPECIFIED ,
2005
- }
2006
-
2007
- _MEASUREMENT_SELECTION_TO_PROTO_VALUE = {
2008
- "best" : gca_study_compat .StudySpec .MeasurementSelectionType .BEST_MEASUREMENT ,
2009
- "last" : gca_study_compat .StudySpec .MeasurementSelectionType .LAST_MEASUREMENT ,
2010
- }
2011
-
2012
-
2013
2001
class HyperparameterTuningJob (_RunnableJob ):
2014
2002
"""Vertex AI Hyperparameter Tuning Job."""
2015
2003
@@ -2215,8 +2203,10 @@ def __init__(
2215
2203
study_spec = gca_study_compat .StudySpec (
2216
2204
metrics = metrics ,
2217
2205
parameters = parameters ,
2218
- algorithm = _SEARCH_ALGORITHM_TO_PROTO_VALUE [search_algorithm ],
2219
- measurement_selection_type = _MEASUREMENT_SELECTION_TO_PROTO_VALUE [
2206
+ algorithm = hyperparameter_tuning .SEARCH_ALGORITHM_TO_PROTO_VALUE [
2207
+ search_algorithm
2208
+ ],
2209
+ measurement_selection_type = hyperparameter_tuning .MEASUREMENT_SELECTION_TO_PROTO_VALUE [
2220
2210
measurement_selection
2221
2211
],
2222
2212
)
You can’t perform that action at this time.
0 commit comments