Skip to content

Commit

Permalink
Add raise Error about enqueue_trial.
Browse files Browse the repository at this point in the history
  • Loading branch information
KanaiYuma-aist committed Apr 9, 2024
1 parent d3bf167 commit 708cfbe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion aiaccel/hpo/samplers/nelder_mead_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def before_trial(self, study: Study, trial: FrozenTrial) -> None:
if "fixed_params" in trial.system_attrs: # enqueued trial
self.nm.enqueued()
fixed_params = trial.system_attrs["fixed_params"]
params = np.array([fixed_params[name] for name in self._search_space])
if fixed_params.keys() == self._search_space.keys():
params = np.array([fixed_params[name] for name in self._search_space])
else:
raise RuntimeError("All parameters must be given when executing enqueue_trial.")
else:
while True:
params = self.nm.get_vertex()
Expand Down

0 comments on commit 708cfbe

Please sign in to comment.