Source code for deephyper.search.hps._eds

from deephyper.search.hps import CBO


[docs]class ExperimentalDesignSearch(CBO): """Centralized Experimental Design Search. It follows a manager-workers architecture where the manager runs the sampling process and workers execute parallel evaluations of the black-box function. Example Usage: >>> max_evals = 100 >>> search = ExperimentalDesignSearch(problem, evaluator, n_points=max_evals, design="grid") >>> results = search.search(max_evals=100) Args: problem (HpProblem): Hyperparameter problem describing the search space to explore. evaluator (Evaluator): An ``Evaluator`` instance responsible of distributing the tasks. random_state (int, optional): Random seed. Defaults to ``None``. log_dir (str, optional): Log directory where search's results are saved. Defaults to ``"."``. verbose (int, optional): Indicate the verbosity level of the search. Defaults to ``0``. n_points (int, optional): Number of points to sample. Defaults to ``None``. design (str, optional): Experimental design to use. Defaults to ``"random"``. - ``"random"`` for uniform random numbers. - ``"sobol"`` for a Sobol' sequence. - ``"halton"`` for a Halton sequence. - ``"hammersly"`` for a Hammersly sequence. - ``"lhs"`` for a latin hypercube sequence. - ``"grid"`` for a uniform grid sequence. initial_points (list, optional): List of initial points to evaluate. Defaults to ``None``. """ def __init__( self, problem, evaluator, random_state: int = None, log_dir: str = ".", verbose: int = 0, n_points: int = None, design: str = "random", initial_points=None, ): if n_points is None: raise ValueError( "n_points must be specified for the ExperimentalDesignSearch." ) super().__init__( problem, evaluator, random_state, log_dir, verbose, n_initial_points=n_points, initial_points=initial_points, initial_point_generator=design, surrogate_model="DUMMY", )