Random search
smac.acquisition.maximizer.random_search
#
RandomSearch
#
RandomSearch(
configspace: ConfigurationSpace,
acquisition_function: (
AbstractAcquisitionFunction | None
) = None,
challengers: int = 5000,
seed: int = 0,
)
Bases: AbstractAcquisitionMaximizer
Get candidate solutions via random sampling of configurations.
Source code in smac/acquisition/maximizer/abstract_acquisition_maximizer.py
acquisition_function
property
writable
#
acquisition_function: AbstractAcquisitionFunction | None
The acquisition function used for maximization.
maximize
#
maximize(
previous_configs: list[Configuration],
n_points: int | None = None,
random_design: AbstractRandomDesign | None = None,
) -> Iterator[Configuration]
Maximize acquisition function using _maximize
, implemented by a subclass.
Parameters#
previous_configs: list[Configuration]
Previous evaluated configurations.
n_points: int, defaults to None
Number of points to be sampled & number of configurations to be returned. If n_points
is not specified,
self._challengers
is used. Semantics depend on concrete implementation.
random_design: AbstractRandomDesign, defaults to None
Part of the returned ChallengerList such that we can interleave random configurations
by a scheme defined by the random design. The method random_design.next_iteration()
is called at the end of this function.
Returns#
challengers : Iterator[Configuration] An iterable consisting of configurations.