pybop.optimisers.ep_bolfi_optimiser#

Classes#

BayesianOptimisationResult

Stores the result of a Bayesian optimisation or a Bayesian model

EPBOLFIOptions

A class to hold EP-BOLFI options for the optimisation process.

EP_BOLFI

Wraps the Bayesian Optimization algorithm EP-BOLFI.

Functions#

Module Contents#

class pybop.optimisers.ep_bolfi_optimiser.BayesianOptimisationResult(optim: EP_BOLFI, time: float | dict, method_name: str | None = None, message: str | None = None, lower_bounds: numpy.ndarray | None = None, upper_bounds: numpy.ndarray | None = None, posterior: pybop.parameters.parameter.Parameters | None = None, maximum_a_posteriori: numpy.ndarray | None = None, log_evidence_mean: float | None = None, log_evidence_variance: float | None = None)[source]#

Bases: pybop.optimisers.base_optimiser.OptimisationResult

Stores the result of a Bayesian optimisation or a Bayesian model selection.

problem#

The optimisation problem used to generate the results.

Type:

pybop.Problem

x#

The solution of the optimisation (in model space).

Type:

ndarray

best_cost#

The cost associated with the solution x.

Type:

float

n_iterations#

Number of iterations performed by the optimiser. Since Bayesian optimisers tend to have layers of various optimisation algorithms, their iteration counts may be put individually.

Type:

int or dict

n_evaluations#

Number of evaluations performed by the optimiser. Since Bayesian optimisers tend to have layers of various optimisation algorithms, their evaluation counts my be put individually.

Type:

int or dict

message#

The reason for stopping given by the optimiser.

Type:

str

lower_bounds#

The lower confidence parameter boundaries.

Type:

ndarray

upper_bounds#

The upper confidence parameter boundaries.

Type:

ndarray

posterior#

The probability distribution of the optimisation.

Type:

MultivariateParameters

maximum_a_posteriori#

Complementing the best observed value in x, this is the prediction for the best parameter value.

Type:

Inputs or ndarray

log_evidence_mean#

The logarithm of the evidence of the parameterization. Higher values are better. May only be interpreted relative to a calibration case, e.g., a test-run with synthetic data.

Type:

float

log_evidence_variance#

The logarithm of the variance in the calculation of the evidence. For reliable comparisons based on the evidence, should be at or below the scale of the evidence itself.

Type:

float

log_evidence_mean = None#
log_evidence_variance = None#
lower_bounds = None#
maximum_a_posteriori = None#
posterior = None#
upper_bounds = None#
class pybop.optimisers.ep_bolfi_optimiser.EPBOLFIOptions[source]#

Bases: pybop.OptimiserOptions

A class to hold EP-BOLFI options for the optimisation process.

For detailed descriptions of the options, consult the EP-BOLFI documentation at YannickNoelStephanKuhn/EP-BOLFI; you’ll find its PDF attached to the newest release. Note that the variable names have been rewritten for clarity here, so you’ll have to look up their “original” names in the ep_bolfi.EP_BOLFI constructor call within the _set_up_optimiser routine of the pybop.EP_BOLFI class.

validate()[source]#

Validate the options.

Raises:

ValueError – If the options are invalid.

bolfi_initial_sobol_samples: int | None = None#
bolfi_optimally_acquired_samples: int | None = None#
bolfi_posterior_effective_sample_size: int | None = None#
boundaries_in_standard_deviations: int = 0#
covariance_scaled_mean: numpy.ndarray | None = None#
covariance_scaled_means_per_feature: numpy.ndarray | None = None#
ep_iterations: int = 1#
ep_randomise_feature_order: bool = False#
ep_stepwise_dampener: float | None = None#
ep_total_dampening: float | None = None#
max_posterior_sampling_retries: int = 10#
model_parameter_boundaries: dict#
parallel: bool = False#
posterior_actual_sample_size_increase: float = 1.2#
posterior_ess_ratio_threshold_evaluation_at_centre: int = -1#
posterior_ess_ratio_threshold_resampling: int = 5#
posterior_ess_ratio_threshold_skip_feature: int = -1#
posterior_gelman_rubin_threshold: float | None = None#
posterior_model_resample_size_increase: float = 1.1#
precision_matrices_per_feature: numpy.ndarray | None = None#
precision_matrix: numpy.ndarray | None = None#
seed: int = 0#
class pybop.optimisers.ep_bolfi_optimiser.EP_BOLFI(problem: pybop.Problem, options: EPBOLFIOptions | None = None)[source]#

Bases: pybop.optimisers.base_optimiser.BaseOptimiser

Wraps the Bayesian Optimization algorithm EP-BOLFI.

For implementation details and background information, consult the relevant publication at https://doi.org/10.1002/batt.202200374 and visit YannickNoelStephanKuhn/EP-BOLFI.

Note that all properties may and should be given here as PyBOP objects, but will be converted to an ep_bolfi.EP_BOLFI instance upon instantiation of this class. To change attributes, re-init.

Only compatible with MultivariateParameters with a MultivariateGaussian distribution.

_run() BayesianOptimisationResult[source]#

Contains the logic for the optimisation algorithm.

This method should be implemented by child classes to perform the actual optimisation.

Raises:

NotImplementedError – If the method has not been implemented by the subclass.

_set_up_optimiser()[source]#

Parse optimiser options and prepare the optimiser.

This method should be implemented by child classes.

Raises:

NotImplementedError – If the method has not been implemented by the subclass.

name()[source]#

Returns the name of the optimiser, to be overwritten by child classes.

Returns:

The name of the optimiser

Return type:

str

pybop.optimisers.ep_bolfi_optimiser.ep_bolfi_problem_processing(y, problem)[source]#