default_integrator module¶
High level interface for integration
- Integrator(f, d, survey_strategy='forward_flat_init', n_iter=10, n_iter_survey=None, n_iter_refine=None, n_points=100000, n_points_survey=None, n_points_refine=None, use_survey=False, device=device(type='cpu'), verbosity=None, trainer_verbosity=None, loss='dkl', flow='pwquad', trainer=None, trainer_options=None, flow_options=None)[source]¶
High level integration API
This is a factory method that instantiates the relevant Integrator subclass based on the options
- Parameters
f (function) – the function to integrate
d (int) – dimensionality of the integration space
survey_strategy (str) – how points are sampled during the survey step: one of
'flat'
,'forward'
,'adaptive_dkl'
,'adaptive_variance'
,'forward_flat_init'
,'fixed_sample'
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
device – pytorch device on which to run
verbosity (int) – verbosity level of the integrator
trainer_verbosity – verbosity level of the trainer
loss (str or function) – loss function used by the trainer
flow (str or flow model) – normalizing flow model to use for importance sampling
trainer (None or
zunis.training.weighted_dataset.weighted_dataset_trainer.BasicStatefulTrainer
) – optional argument to provide a full trainer object - overrides any other trainer or model setup argumenttrainer_options (dict) – dictionary of options to pass to the
zunis.training.weighted_dataset.stateful_trainer.StatefulTrainer
created iftrainer
is Noneflow_options (dict) – dictionary of options to pass to the
zunis.models.flows.sequential.repeated_cell.RepeatedCellFlow
created by the stateful trainer iftrainer
is None
- Returns
- Return type
subclass of
zunis.models.flows.sequential.repeated_cell.RepeatedCellFlow