deephyper.skopt.utils.Grid#
- class deephyper.skopt.utils.Grid(border='exclude', use_full_layout=True, append_border='only')[source]#
Bases:
InitialPointGenerator
Generate samples from a regular grid.
- Parameters:
border (str, default='exclude') – defines how the samples are generated: - ‘include’ : Includes the border into the grid layout - ‘exclude’ : Excludes the border from the grid layout - ‘only’ : Selects only points at the border of the dimension
use_full_layout (boolean, default=True) – When True, a full factorial design is generated and missing points are taken from the next larger full factorial design, depending on append_border When False, the next larger full factorial design is generated and points are randomly selected from it.
append_border (str, default="only") – When use_full_layout is True, this parameter defines how the missing points will be generated from the next larger grid layout: - ‘include’ : Includes the border into the grid layout - ‘exclude’ : Excludes the border from the grid layout - ‘only’ : Selects only points at the border of the dimension
Methods
Creates samples from a regular grid.
Set the parameters of this initial point generator.
- generate(dimensions, n_samples, random_state=None)[source]#
Creates samples from a regular grid.
- Parameters:
dimensions (list, shape (n_dims,)) –
List of search space dimensions. Each search dimension can be defined either as
a (lower_bound, upper_bound) tuple (for Real or Integer dimensions),
a (lower_bound, upper_bound, “prior”) tuple (for Real dimensions),
as a list of categories (for Categorical dimensions), or
an instance of a Dimension object (Real, Integer or Categorical).
n_samples (int) – The order of the Halton sequence. Defines the number of samples.
random_state (int, RandomState instance, or None (default)) – Set random state to something other than None for reproducible results.
- Returns:
grid set
- Return type:
np.array, shape=(n_dim, n_samples)