Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions bayes_opt/acquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
TargetSpaceEmptyError,
)
from bayes_opt.target_space import TargetSpace
from bayes_opt.util import ensure_rng

if TYPE_CHECKING:
from collections.abc import Callable, Sequence
Expand All @@ -60,13 +61,7 @@ class AcquisitionFunction(abc.ABC):
"""

def __init__(self, random_state: int | RandomState | None = None) -> None:
if random_state is not None:
if isinstance(random_state, RandomState):
self.random_state = random_state
else:
self.random_state = RandomState(random_state)
else:
self.random_state = RandomState()
self.random_state = ensure_rng(random_state)
self.i = 0

def _serialize_random_state(self) -> dict | None:
Expand Down