Skip to content
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

Refine HPO #2175

Merged
Merged
Prev Previous commit
Next Next commit
add unit test
  • Loading branch information
eunwoosh committed May 23, 2023
commit eb8eac2edaaaa2072ee376426fee1e570fac98ff
6 changes: 6 additions & 0 deletions tests/unit/hpo/test_hyperband.py
Original file line number Diff line number Diff line change
@@ -932,6 +932,7 @@ def test_without_maximum_resource(self, good_hyperband_args, num_trial_to_estima
hyper_band.report_score(score=0, resource=0, trial_id=first_trial.id, done=True)

assert hyper_band.maximum_resource == max_validation
assert first_trial.estimating_max_resource

@e2e_pytest_component
@pytest.mark.parametrize("num_trial_to_estimate", [10, 30, 100])
@@ -961,6 +962,8 @@ def test_auto_config_decrease_without_maximum_resource(self, good_hyperband_args
break

first_trial = trials_to_estimate[0]
assert first_trial.estimating_max_resource

hyperband.report_score(score=1, resource=max_validation, trial_id=first_trial.id)
hyperband.report_score(score=0, resource=0, trial_id=first_trial.id, done=True)

@@ -1006,6 +1009,8 @@ def test_auto_config_increase_without_maximum_resource(self, good_hyperband_args
break

first_trial = trials_to_estimate[0]
assert first_trial.estimating_max_resource

hyperband.report_score(score=1, resource=max_validation, trial_id=first_trial.id)
hyperband.report_score(score=0, resource=0, trial_id=first_trial.id, done=True)

@@ -1066,6 +1071,7 @@ def test_without_minimum_maximum_resource(self, good_hyperband_args, num_trial_t

expected_min = hyper_band.maximum_resource * (good_hyperband_args["reduction_factor"] ** -s_max)

assert first_trial.estimating_max_resource
assert min(iter_set) == expected_min
assert hyper_band.maximum_resource == max_validation