deephyper.skopt.utils.Sobol#

class deephyper.skopt.utils.Sobol(skip=0, randomize=True)[source]#

Bases: InitialPointGenerator

Generates a new quasirandom Sobol’ vector with each call.

Parameters:
  • skip (int) – Skipped seed number.

  • randomize (bool, default=False) – When set to True, random shift is applied.

Notes

Sobol’ sequences [1] provide \(n=2^m\) low discrepancy points in \([0,1)^{dim}\). Scrambling them makes them suitable for singular integrands, provides a means of error estimation, and can improve their rate of convergence.

There are many versions of Sobol’ sequences depending on their ‘direction numbers’. Here, the maximum number of dimension is 40.

The routine adapts the ideas of Antonov and Saleev [2].

Warning

Sobol’ sequences are a quadrature rule and they lose their balance properties if one uses a sample size that is not a power of 2, or skips the first point, or thins the sequence [5].

If \(n=2^m\) points are not enough then one should take \(2^M\) points for \(M>m\). When scrambling, the number R of independent replicates does not have to be a power of 2.

Sobol’ sequences are generated to some number \(B\) of bits. Then after \(2^B\) points have been generated, the sequence will repeat. Currently \(B=30\).

References

Methods

generate

Creates samples from Sobol' set.

init

set_params

Set the parameters of this initial point generator.

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

Creates samples from Sobol’ 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 Sobol’ 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:

sample – Sobol’ set.

Return type:

array_like (n_samples, dim)

set_params(**params)#

Set the parameters of this initial point generator.

Parameters:

**params (dict) – Generator parameters.

Returns:

self – Generator instance.

Return type:

object