integratorAPI module

class SurveyRefineIntegratorAPI(*args, **kwargs)[source]

Bases: better_abc.ABC

API specification for an integrator that performs a number of survey steps in which a flow model is trained and then a number of refine steps in which sampling is done through the model The interaction with the model is done through the GenericTrainerAPI

abstract finalize_integration(**kwargs)[source]

Perform the final operations of the whole integration

abstract finalize_refine(**kwargs)[source]

Perform the final operations of the refine phase

abstract finalize_survey(**kwargs)[source]

Perform the final operations of the survey phase

format_arguments(**kwargs)[source]

Format keyword arguments passed to the train function in a suitable way In this generic API definition, the kwargs must be passed in the correct format however for a specific realization, options should be made accessible through keywords which will then be sorted into the right structure.

abstract initialize(**kwargs)[source]

Intialization before the whole integration process

abstract initialize_refine(**kwargs)[source]

Initialization before the survey phase

abstract initialize_survey(**kwargs)[source]

Initialization before the survey phase

integrate(n_survey_steps=10, n_refine_steps=10, **kwargs)[source]
abstract process_refine_step(sample, integral, integral_var, **kwargs)[source]

Process the result of a refine step

abstract process_survey_step(sample, integral, integral_var, **kwargs)[source]

Process the result of a survey step

refine(n_refine_steps=10, **kwargs)[source]

Perform the refine phase of integration

Possible keyword arguments:

trainer_config_args: dict refine_step_args: dict finalize_refine_args: dict

refine_step(**kwargs)[source]

Basic refine step: sample points, estimate the integral, its error, train model

possible keyword arguments:

sampling_args: dict

abstract sample_refine(**kwargs)[source]

Sample points for a refine step

abstract sample_survey(**kwargs)[source]

Sample points for a survey step

set_verbosity(level)[source]
survey(n_survey_steps=10, **kwargs)[source]

Perform a survey phase of integration

possible keyword arguments:

trainer_config_args: dict survey_step_args: dict finalize_survey_args: dict

survey_step(**kwargs)[source]

Basic survey step: sample points, estimate the integral, its error, train model

possible keyword arguments:

sampling_args: dict training_args: dict