utils

bojaxns.utils

Module Contents

latin_hypercube(seed, num_samples, num_dim)[source]

Sample from the latin-hypercube defined as the continuous analog of the discrete latin-hypercube. That is, if you partition each dimension into num_samples equal volume intervals then there is (conditionally) exactly one point in each interval. We guarantee that uniformity by randomly assigning the permutation of each dimension. The degree of randomness is controlled by cube_scale. A value of 0 places the sample at the center of the grid point, and a value of 1 places the value randomly inside the grid-cell.

Parameters:
  • key – PRNG key

  • num_samples (int) – number of samples in total to draw

  • num_dim (int) – number of dimensions in each sample

  • cube_scale – The scale of randomness, in (0,1).

  • seed (int) –

Returns:

latin-hypercube samples of shape [num_samples, num_dim]

build_example(model)[source]
Parameters:

model (Type[_T]) –

Return type:

_T

current_utc()[source]
Return type:

datetime.datetime