romtools.workflows.inverse.ego_drivers#

Single-fidelity efficient global optimization drivers.

This module provides an efficient global optimization (EGO) workflow for black-box forward models. The algorithm fits model outputs with a Gaussian Processes, then uses an ‘expected improvement’ metric to determine the next point to sample. ‘Expected improvement’ balances exploration of a design space with exploitation of know minima of a function.

Functions

run_batch_ego(model, parameter_space, ...[, ...])

Run a single-fidelity batch efficient global optimization

run_ego(model, parameter_space, ...[, ...])

Run a single-fidelity efficient global optimization

romtools.workflows.inverse.ego_drivers.run_batch_ego(model, parameter_space, observations, number_of_iterations, batch_size, parameter_mins=None, parameter_maxes=None, absolute_ego_directory='/home/runner/work/rom-tools-and-workflows/rom-tools-and-workflows/work/', number_initial_samples=4, random_seed=None, evaluation_concurrency=-1, use_relative_error=True, restart_file=None, expected_improvement_epsilon=0.0, constant_liar_type='pessimistic')[source]#

Run a single-fidelity batch efficient global optimization

Parameters:
  • model (QoiModel) – QoiModel to evaluate at ensemble samples.

  • parameter_space (ParameterSpace) – ParameterSpace used to draw the initial ensemble when restart_file is not provided.

  • observations (ndarray) – Observed QoI vector \(y\).

  • number_of_iterations (int) – Number of EGO iterations.

  • batch_size (int) – number of function evaluations per iteration.

  • parameter_mins (ndarray) – Optional lower bounds applied to sampled and updated parameters.

  • parameter_maxes (ndarray) – Optional upper bounds applied to sampled and updated parameters.

  • absolute_ego_directory (str) – Absolute path to the working directory. Each accepted or tested iteration writes into iteration_<k>/run_* subdirectories under this path.

  • number_initial_samples (int) – Optional number of model samples to train the initial Gaussian process. Default is 4.

  • random_seed (int) – Optional seed to fix random sampling. Default is None.

  • evaluation_concurrency (int) – Number of concurrent model evaluations used by each batch EGO iteration. Default is the batch_size

  • use_relative_error (bool) – Optional boolean to use relative error with respect to observations as the objective runtion. Default is None.

  • restart_file (str) – Optional .npz restart file produced by a prior EGO run. When set, the saved samples and QoIs are restored instead of drawing a new sample.

  • expected_improvement_epsilon (float) – Optional parameter for expected improvement. Values greater than zero will promote design space exploration

  • constant_liar_type (str) – Optional string for type of constant liar aquisition function. Valid options are “pessimistic”, “optimistic”, and “average”.

Returns:

Tuple (parameter_sample_min, obj_min, qoi_min) containing the final input parameters and the corresponding minimum objective function and QoI as of the last iteration.

romtools.workflows.inverse.ego_drivers.run_ego(model, parameter_space, observations, number_of_iterations, parameter_mins=None, parameter_maxes=None, absolute_ego_directory='/home/runner/work/rom-tools-and-workflows/rom-tools-and-workflows/work/', number_initial_samples=4, random_seed=None, use_relative_error=True, restart_file=None, expected_improvement_epsilon=0.0)[source]#

Run a single-fidelity efficient global optimization

Parameters:
  • model (QoiModel) – QoiModel to evaluate at ensemble samples.

  • parameter_space (ParameterSpace) – ParameterSpace used to draw the initial ensemble when restart_file is not provided.

  • observations (ndarray) – Observed QoI vector \(y\).

  • parameter_mins (ndarray) – Optional lower bounds applied to sampled and updated parameters.

  • parameter_maxes (ndarray) – Optional upper bounds applied to sampled and updated parameters.

  • absolute_ego_directory (str) – Absolute path to the working directory. Each accepted or tested iteration writes into iteration_<k>/run_* subdirectories under this path.

  • number_initial_samples (int) – Optional number of model samples to train the initial Gaussian process. Default is 4.

  • random_seed (int) – Optional seed to fix random sampling. Default is None.

  • use_relative_error (bool) – Optional boolean to use relative error with respect to observations as the objective runtion. Default is None.

  • restart_file (str) – Optional .npz restart file produced by a prior EGO run. When set, the saved samples and QoIs are restored instead of drawing a new sample.

  • expected_improvement_epsilon (float) – Optional parameter for expected improvement. Values greater than zero will promote design space exploration

  • number_of_iterations (int)

Returns:

Tuple (parameter_sample_min, obj_min, qoi_min) containing the final input parameters and the corresponding minimum objective function and QoI as of the last iteration.