utils.vegas_integrals module¶
- class VegasSampler(*args, **kwargs)[source]¶
Bases:
utils.integral_validation.Sampler
- Parameters
integrator –
train –
n_survey_steps –
n_batch –
- sample(f, n_batch=10000, *args, **kwargs)[source]¶
- Parameters
f (utils.integrands.Integrand) –
n_batch (int) –
- Returns
tuple of torch.Tensor
x,px,fx (points, pdfs, function values)
- evaluate_integral_vegas(f, integrator, n_batch=10000, train=True, n_survey_steps=10, n_batch_survey=10000, stratified=False)[source]¶
Validate a known integral using a VEGAS integrator as a sampler
- Parameters
f (utils.integrands.KnownIntegrand) –
integrator (zunis.integration.adaptive_survey_integrator.AdaptiveSurveyIntegrator) –
n_batch (int) –
train (bool) – whether to train the integrator using
integrator.survey
n_survey_steps (int or None) – positional
integrator.survey
argumentn_batch_survey (int or None) –
stratified (bool) – whether to use VEGAS stratified sampling
- Returns
- Return type