Skip to content

Commit d7a0f1c

Browse files
committed
check max_runtime >= max_budget when budget type is time
1 parent e95bb7f commit d7a0f1c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autoPyTorch/pipeline/nodes/optimization_algorithm.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,12 @@ def get_pipeline_config_options(self):
144144
return options
145145

146146
def get_pipeline_config_conditions(self):
147+
def check_runtime(pipeline_config):
148+
return pipeline_config["budget_type"] != "time" or pipeline_config["max_runtime"] >= pipeline_config["max_budget"]
149+
147150
return [
148-
ConfigCondition.get_larger_equals_condition("max budget must be greater than or equal to min budget", "max_budget", "min_budget")
151+
ConfigCondition.get_larger_equals_condition("max budget must be greater than or equal to min budget", "max_budget", "min_budget"),
152+
ConfigCondition("When time is used as budget, the max_runtime must be larger than the max_budget", check_runtime)
149153
]
150154

151155
def get_default_network_interface_name(self):

0 commit comments

Comments
 (0)