deephyper.skopt.sampler.halton.Halton

deephyper.skopt.sampler.halton.Halton#

class deephyper.skopt.sampler.halton.Halton(min_skip=0, max_skip=0, primes=None)[source]#

Bases: InitialPointGenerator

Creates Halton sequence samples.

In statistics, Halton sequences are sequences used to generate points in space for numerical methods such as Monte Carlo simulations. Although these sequences are deterministic, they are of low discrepancy, that is, appear to be random for many purposes. They were first introduced in 1960 and are an example of a quasi-random number sequence. They generalise the one-dimensional van der Corput sequences.

For dim == 1 the sequence falls back to Van Der Corput sequence.

Parameters:
  • min_skip (int) – Minimum skipped seed number. When min_skip != max_skip a random number is picked.

  • max_skip (int) – Maximum skipped seed number. When min_skip != max_skip a random number is picked.

  • primes (tuple, default=None) – The (non-)prime base to calculate values along each axis. If empty or None, growing prime values starting from 2 will be used.

Methods

generate

Creates samples from Halton set.

set_params

Set the parameters of this initial point generator.

generate(dimensions, n_samples, random_state=None)[source]#

Creates samples from Halton set.

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:

Halton set.

Return type:

np.array, shape=(n_dim, n_samples)

set_params(**params)#

Set the parameters of this initial point generator.

Parameters:

**params (dict) – Generator parameters.

Returns:

self – Generator instance.

Return type:

object