evox.operators.sampling.latin_hypercube

Module Contents

Functions

latin_hypercube_sampling_standard

Generate Latin Hypercube samples in the unit hypercube.

latin_hypercube_sampling

Generate Latin Hypercube samples in the given hypercube defined by lb and ub.

API

evox.operators.sampling.latin_hypercube.latin_hypercube_sampling_standard(n: int, d: int, device: torch.device, smooth: bool = True)[source]

Generate Latin Hypercube samples in the unit hypercube.

Parameters:
  • n – The number of sample points to generate.

  • d – The dimensionality of the samples.

  • device – The device on which to generate the samples.

  • smooth – Whether to generate sample in random positions in the cells or not. Defaults to True.

Returns:

A tensor of shape (n, d), where each row represents a sample point and each column represents a dimension.

evox.operators.sampling.latin_hypercube.latin_hypercube_sampling(n: int, lb: torch.Tensor, ub: torch.Tensor, smooth: bool = True)[source]

Generate Latin Hypercube samples in the given hypercube defined by lb and ub.

Parameters:
  • n – The number of sample points to generate.

  • lb – The lower bounds of the hypercube. Must be a 1D tensor of size d with same shape, dtype, and device as ub.

  • ub – The upper bounds of the hypercube. Must be a 1D tensor of size d with same shape, dtype, and device as lb.

  • smooth – Whether to generate sample in random positions in the cells or not. Defaults to True.

Returns:

A tensor of shape (n, d), where each row represents a sample point and each column represents a dimension whose device is the same as lb and ub.