Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nabenabe0928 committed Oct 24, 2024
1 parent e9e7b95 commit 2bfad4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions package/samplers/auto_sampler/sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ def sample_independent(
return self._sampler.sample_independent(study, trial, param_name, param_distribution)

def before_trial(self, study: Study, trial: FrozenTrial) -> None:
# NOTE(nabenabe): Use the states used in IntersectionSearchSpace().calculate.
states_of_interest = [TrialState.COMPLETE, TrialState.WAITING, TrialState.RUNNING]
states_of_interest = [TrialState.COMPLETE, TrialState.WAITING]
if len(study._get_trials(deepcopy=False, states=states_of_interest)) != 0:
search_space = IntersectionSearchSpace().calculate(study)
self._sampler = self._determine_sampler(study, trial, search_space)
Expand Down
3 changes: 3 additions & 0 deletions package/samplers/auto_sampler/tests/test_auto_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,6 @@ def test_choose_tpe_with_conditional_params() -> None:
assert ["RandomSampler"] + ["GPSampler"] * 15 + ["TPESampler"] * (
n_trials - 16
) == sampler_names


# TODO: Add a test with enqueue_trial.

0 comments on commit 2bfad4b

Please sign in to comment.