Grid Search¶
does this and that…
-
class
olympus.planners.
Grid
(*args, **kwargs)[source] Grid search.
Note that the number of samples grow exponentially with the number of dimensions. E.g. for a 2-dimensional parameter space, with 2 levels, the grid will contain 4 samples; for a 3-dimensional space, it will contain 8 samples; for a 6-dimensional space, 64 samples.
- Parameters
goal (str) – The optimization goal, either ‘minimize’ or ‘maximize’. Default is ‘minimize’.
levels (int, list) – How many locations in parameter space to sample per parameter/dimension. If an integer is provided, the same number of levels will be used for each dimension. Provide a list to use different levels for different dimensions. Default is 2.
budget (int) – Maximum number of samples you want to evaluate. From the specified
budget
an adequate value for the levels will be derived. Note that, if provided, the argumentlevels
will be discarded. Default is None.exceed_budget (bool) – Whether to allow building the grid with more samples then
budget
. This means some points might not be evaluated, but ensures there will be enough grid points to run as many evaluations as defined inbudget
. If False, the number of grid points will be less or equal tobudget
; this guarantees the budget is enough to guarantee the exploration of the whole grid. Default is True.shuffle (bool) – Whether to randomize the order of the samples in the grid. Default is False.
random_seed (int) – Random seed. Set a random seed for a reproducible randomization of the grid if
shuffle
was set to True.
Methods
tell
([observations])Provide the planner with all previous observations.
ask
([return_as])suggest new set of parameters
recommend
([observations, return_as])Consecutively executes tell and ask: tell the planner about all previous observations, and ask about the next query point.
optimize
(emulator[, num_iter, verbose])Optimizes a surface for a fixed number of iterations.
reset
()Clears the remaining samples in the grid and prepares the planner for re-initialisation.