Skip to content

Commit

Permalink
add rng in NelderMeadSampler argment.
Browse files Browse the repository at this point in the history
  • Loading branch information
KanaiYuma-aist committed Mar 26, 2024
1 parent cc82cd1 commit 32bf9d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion aiaccel/hpo/samplers/nelder_mead_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,17 @@ def __init__(
self,
search_space: dict[str, tuple[float, float]],
seed: int | None = None,
rng: np.random.RandomState | None = None,
coeff: NelderMeadCoefficient | None = None,
parallel_enabled: bool = False,
) -> None:
self._search_space = search_space
_rng = rng if rng is not None else np.random.RandomState(seed) if seed is not None else np.random.RandomState()

self.nm = NelderMeadAlgorism(
search_space=self._search_space,
coeff=coeff,
rng=np.random.RandomState(seed),
rng=_rng,
block=parallel_enabled,
timeout=None
)
Expand Down

0 comments on commit 32bf9d3

Please sign in to comment.