Reference
Contents
Index
Vegas.AbstractTargetDistributionVegas.VegasBatchBufferVegas.VegasCPU.AbstractProcessSetupVegas.VegasGridVegas.VegasOutBufferVegas.TestUtils.get_test_setupVegas.VegasCPU._build_pspVegas.VegasCPU._computeVegas.VegasCPU.coordinate_boundariesVegas.VegasCPU.degree_of_freedomVegas._computeVegas._gen_gridVegas.degrees_of_freedomVegas.vegas_binning_kernel_batched!
Vegas.AbstractTargetDistribution — Type
AbstractTargetDistributionAbstract base type for target distributions used in sampling.
Concrete subtypes represent functions defined on an N-dimensional real domain and must implement the following interface:
Required Methods
_compute(dist, x::NTuple{N,<:Real})::RealEvaluate the (possibly unnormalized) target distribution at the pointx.degrees_of_freedom(dist)::IntReturn the number of degrees of freedom, i.e. the dimensionality of the domain on which the distribution is defined.
Notes
- Implementations are expected to be side-effect free and compatible with GPU execution.
- Broadcasting over an
AbstractTargetDistributiontreats the distribution as a scalar.
See also
Vegas.VegasBatchBuffer — Type
VegasBatchBuffer{T, N, D, V, W, J}Buffer object for Vegas on the GPU.
Template parameters:
T: Basic data type used throughout, e.g.Float32N: Size of the buffer, "batch_size", for example1024D: Dimensionality of the samples, for example3V: The type of the values (samples), backend specific matrix type, size according to previously defined N and DW: The type of the weights, backend specific vector type, size according to previously defined NJ: The type of the jacobians, backend specific vector type, size according to previously defined NB: The block size used internally for execution, can affect the performance.Nmust be a multiple of this.
Members:
values::V: The sampled valuestarget_weights::W: The calculated weights of the samplesjacobians::J: The calculated jacobians of the samples
Allocate this through allocate_vegas_batch.
eltype(), length(), size(), and get_backend() are statically defined on this buffer.
Vegas.VegasGrid — Type
VegasGrid{T, N, D, G}The GPU allocated Vegas grid.
Templates:
T: The basic data type, e.g.Float32N: The number of grid lines of the Vegas grid per dimension, e.g.100D: The dimensionality of the Vegas grid, e.g.3G: The complete type of the grid, including GPU backend information, a vector (if 1D) or matrix
Members:
nodes::G: The vegas grid lines
Allocate this through allocate_vegas_grid() and use fill_uniformly!() to initialize it as a uniform grid. Alternatively, do both in one step using uniform_vegas_grid().
eltype(), nbins(), ndims(), and get_backend() are statically defined on this grid.
Vegas.VegasOutBuffer — Type
VegasOutBuffer{T, V}The GPU buffer for some statistical values used during training.
Templates:
T: The underlying element type, for exampleFloat32V: The actual backend aware vector type
Members:
weighted_mean::V: The weighted mean, only one value so the vector has length 1variance::V: The variance, only one value so the vector has length 1chi_squared::V: The chi squared statistic, only one value so the vector has length 1
eltype() is statically defined on this type.
Allocate using _allocate_vegas_output.
Vegas._compute — Function
_compute(dist::AbstractTargetDistribution,x::NTuple{N,<:Real})::RealInterface function: Return value of dist computed at x.
Vegas._gen_grid — Method
_gen_grid(bins, dists::Tuple)Sets up the D-dimensional grid with the distributions, where dists is a tuple of D distributions that implement the quantile and cdf functions.
Vegas.degrees_of_freedom — Function
degrees_of_freedom(dist::AbstractTargetDistribution)::IntInterface function: return the degrees of freedom of dist, e.g. the dimension of the domain.
Vegas.vegas_binning_kernel_batched! — Method
Batched binning kernel. The grid layout is three-dimensional, the first dimension is in the number of bins, the second the dimensionality of the samples, the third is the number of batches. The given batch_size times the third block dimension must equal the number of samples.
TestUtils
Vegas.TestUtils.get_test_setup — Function
get_test_setup(backend::KernelAbstractions.Backend)Interface function: return test setup for given backend.
CPU version (to be deprecated)
Vegas.VegasCPU.AbstractProcessSetup — Type
AbstractProcessSetup{P,M,PSL}Abstract base type for setups related to scattering processes with
P<:AbstractProcessDefinition,M<:AbstractModelDefinition,PSL<:AbstractPhaseSpaceLayout.
Interface function to be implemented:
QEDbase.process(stp::AbstractProcessSetup)::P,QEDbase.model(stp::AbstractProcessSetup)::M,QEDbase.phase_space_layout(stp::AbstractProcessSetup)::PSL,_compute(stp::AbstractProcessSetup, psp::AbstractPhaseSpacePoint)::Real.
Optionally, the following interface functions can be implemented:
_build_psp(stp::AbstractProcessSetup,coords::Tuple)::PSPdegree_of_freedom(stp::AbstractProcessSetup)::Int,coordinate_boundaries(stp::AbstractProcessSetup)::Tuple,
A leading underscore of an interface function means, there is no input validation necessary, because there is a generic implementation of the same function without the underscore, which does basic compiletime checks.
Vegas.VegasCPU._build_psp — Function
_build_psp(stp::AbstractProcessSetup, coords::Tuple)Vegas.VegasCPU._compute — Function
_compute(stp::AbstractComputationSetup,input::Any)Vegas.VegasCPU.coordinate_boundaries — Function
coordinate_boundaries(stp::AbstractProcessSetup)Vegas.VegasCPU.degree_of_freedom — Function
degree_of_freedom(stp::AbstractProcessSetup)