utils.integrator_integrals module¶
Facilities to compute, estimate and benchmark integrals performed with Integrator objects
- class IntegratorSampler(*args, **kwargs)[source]¶
Bases:
utils.integral_validation.Sampler
Sampler using an Integrator’s sample_refine method
- Parameters
integrator (zunis.integration.flat_survey_integrator.PosteriorSurveySamplingIntegrator) –
train (bool) – whether to train the integrator by running
integrator.survey
n_survey_steps (int, None) – if train is
True
, how many survey steps to use for training. If None, use the configuration set at the creation of the Integratorsurvey_args (None or dict) – if train is
True
, additional survey options to pass tointegrator.survey
- evaluate_integral_integrator(f, integrator, n_batch=10000, train=True, n_survey_steps=None, survey_args=None, keep_history=False)[source]¶
Validate a known integral using an integrator as a sampler
- Parameters
f (utils.integrands.KnownIntegrand) –
integrator (zunis.integration.flat_survey_integrator.PosteriorSurveySamplingIntegrator) –
n_batch (int) –
train (bool) – whether to train the integrator using
integrator.survey
n_survey_steps (int, optional) – positional
integrator.survey
argument. Use the attribute n_iter_survey set at instantiation if not specified.survey_args (None or dict) – optional keyword-argument dictionary for
integrator.survey
keep_history (bool) – whether to keep track of the training history
- Returns
- Return type
- validate_integral_integrator(f, integrator, n_batch=10000, sigma_cutoff=2, train=True, n_survey_steps=None, survey_args=None, keep_history=False)[source]¶
Validate a known integral using an integrator as a sampler
- Parameters
f (utils.integrands.KnownIntegrand) –
integrator (zunis.integration.adaptive_survey_integrator.AdaptiveSurveyIntegrator) –
n_batch (int) –
sigma_cutoff (int) –
train (bool) – whether to train the integrator using
integrator.survey
n_survey_steps (int) – positional
integrator.survey
argumentsurvey_args (None or dict) – optional keyword-argument dictionary for
integrator.survey
keep_history (bool) – whether to keep track of the training history
- Returns
- Return type