VegasMapping

class VegasMapping : public madspace::Mapping

VEGAS adaptive-sampling mapping.

A separable piecewise-linear reparametrization of the unit hypercube, one axis-aligned grid of bin_count bins per dimension, adapted to the integrand during a warm-up run [1, 2]. The grid is a compute-graph global named after prefix; call initialize_globals(context) once before use.

batch is the leading batch dimension.

Inputs

  • latent – float, shape (batch, dimension) – uniform coordinates in [0, 1).

Conditions

  • None.

Outputs

  • data – float, shape (batch, dimension) – the reparametrized coordinates.

In addition every mapping returns a weight (float, shape (batch,)), the Jacobian of the transformation.

References

Public Functions

VegasMapping(std::size_t dimension, std::size_t bin_count, const std::string &prefix = "")
Parameters:
  • dimension – Number of dimensions.

  • bin_count – Number of grid bins per dimension.

  • prefix – Prefix for the grid global name.

inline const std::string &grid_name() const

Global name of the VEGAS grid.

void initialize_globals(ContextPtr context) const

Register the grid global on context.

inline std::size_t dimension() const

Number of dimensions.

inline std::size_t bin_count() const

Number of grid bins per dimension.