zunis.integration.adaptive_survey_integrator module¶
- class AdaptiveSurveyIntegrator(*args, **kwargs)[source]¶
Bases:
zunis.integration.flat_survey_integrator.FlatSurveySamplingIntegratorAdaptive integrator based on a separation between survey and sampling
- Survey:
Sample points and spend some time training the model
Sampling is done in two phases:
Sample in the target space (input space of the integrand) using a uniform distribution
Sample in the latent space and use the model to sample point in the target space
The switch between the two phases is performed based on a test method - abstract here - that checks whether the flat distribution does a better job of estimating the loss than the flat distribution
- Refine:
Sample points using the trained model and evaluate the integral
- Parameters
f (function) – the function to integrate
n_iter (int) – general number of iterations - ignored for survey/refine if n_iter_survey/n_inter_refine is set
n_iter_survey (int) – number of iterations for the survey stage
n_iter_refine (int) – number of iterations for the refine stage
n_points – general number of points per iteration - ignored for survey/refine if n_points_survey/n_points_refine is set
n_points_survey (int) – number of points per iteration for the survey stage
n_points_refine (int) – number of points per iteration for the refine stage
use_survey (bool) – whether to use the points generated during the survey to compute the final integral not recommended due to uncontrolled correlations in error estimates
verbosity (int) – verbosity level of the integrator
- process_survey_step(sample, integral, integral_var, training_record, **kwargs)[source]¶
Process the result of a survey step
- class ForwardSurveySamplingIntegrator(*args, **kwargs)[source]¶
Bases:
zunis.integration.adaptive_survey_integrator.AdaptiveSurveyIntegratorSurvey/Refine integrator using forward sampling for training during the survey phase.
The constructor option
ForwardSurveySamplingIntegrator(default:False) allows using flat latent space sampling for the first survey step, then switching to forward sampling.- Parameters
f (function) – the function to integrate
n_iter (int) – general number of iterations - ignored for survey/refine if n_iter_survey/n_inter_refine is set
n_iter_survey (int) – number of iterations for the survey stage
n_iter_refine (int) – number of iterations for the refine stage
n_points – general number of points per iteration - ignored for survey/refine if n_points_survey/n_points_refine is set
n_points_survey (int) – number of points per iteration for the survey stage
n_points_refine (int) – number of points per iteration for the refine stage
use_survey (bool) – whether to use the points generated during the survey to compute the final integral not recommended due to uncontrolled correlations in error estimates
verbosity (int) – verbosity level of the integrator