VegasMapping

class madspace.VegasMapping(self: madspace._madspace_py.VegasMapping, dimension: SupportsInt, bin_count: SupportsInt, prefix: str = '')

Bases: 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

Parameters:
  • dimension – Number of dimensions.

  • bin_count – Number of grid bins per dimension.

  • prefix – Prefix for the grid global name.

bin_count(self: madspace._madspace_py.VegasMapping) → int

Number of grid bins per dimension.

dimension(self: madspace._madspace_py.VegasMapping) → int

Number of dimensions.

grid_name(self: madspace._madspace_py.VegasMapping) → str

Global name of the VEGAS grid.

initialize_globals(self: madspace._madspace_py.VegasMapping, context: madspace._madspace_py.Context) → None

Register the grid global on context.