utils.integrands.camel module

class CamelIntegrand(*args, **kwargs)[source]

Bases: utils.integrands.abstract.Integrand

Camel function: two gaussian peaks on the hyperdiagonal of the unit hypercube at points (0.25, …, 0.25) and (0.75, …, 0.75).

Parameters
  • s1 (float or torch.Tensor) – std of the first gaussian. Either a scalar or a vector of size d

  • s2 (float or torch.Tensor) – std of the second gaussian. Either a scalar or a vector of size d

  • norm1 (float or torch.Tensor) – normalization of the first gaussian. Must be a scalar.

  • norm2 (float or torch.Tensor) – normalization of the second gaussian. Must be a scalar.

  • device (default device on which to run the computation) –

evaluate_integrand(x)[source]

Compute the camel function for a batch of points

Parameters

x (torch.Tensor) –

Returns

Return type

torch.Tensor

class KnownSymmetricCamelIntegrand(*args, **kwargs)[source]

Bases: utils.integrands.camel.SymmetricCamelIntegrand, utils.integrands.abstract.KnownIntegrand

Camel function: two gaussian peaks on the hyperdiagonal of the unit hypercube at points (0.25, …, 0.25) and (0.75, …, 0.75), with an exact integral value provided using pytorch.erf

Parameters
  • s1 (float or torch.Tensor) – std of the first gaussian. Either a scalar or a vector of size d

  • s2 (float or torch.Tensor) – std of the second gaussian. Either a scalar or a vector of size d

  • norm1 (float or torch.Tensor) – normalization of the first gaussian. Must be a scalar.

  • norm2 (float or torch.Tensor) – normalization of the second gaussian. Must be a scalar.

  • device (default device on which to run the computation) –

integral()[source]

Compute the true value of the integral

class SymmetricCamelIntegrand(*args, **kwargs)[source]

Bases: utils.integrands.camel.CamelIntegrand

Camel integrands with two identical humps

Parameters
  • s (float or torch.Tensor) – std of the two gaussians. Either a scalar or a vector of size d

  • norm (float or torch.Tensor) – normalization of the two gaussians. Must be a scalar.

  • device (default device on which to run the computation) –