Search Techniques
A search technique is associated with each simulation when the
simulation dictionary is added to the MOOP object.
This technique is used for generating simulation data prior to the
first iteration of ParMOO, so that the initial surrogate models can
be fit.
For most search techniques, it is highly recommended that you supply the following optional hyperparameter keys/values:
search_budget (int): specifies how many samples will be generated for this simulation.
from parmoo import searches
It is also possible to import and extend the GlobalSearch ABC to implement
a custom global search technique.
from parmoo.searches.global_search import GlobalSearch
The GlobalSearch ABC and existing library of search techniques are
documented below.
GlobalSearch
The abstract base class (ABC) for GlobalSearch methods.
- class searches.global_search.GlobalSearch(o, lb, ub, hyperparams)
ABC describing global search techniques.
- This class contains the following methods.
startSearch(lb, ub)resumeSearch()save(filename)load(filename)
- abstract __init__(o, lb, ub, hyperparams)
Constructor for the GlobalSearch class.
- Parameters:
o (int) – The number of objectives.
lb (ndarray) – A 1D array of lower bounds for the design space.
ub (ndarray) – A 1D array of upper bounds for the design space.
hyperparams (dict) – A dictionary of hyperparameters for the global search. It may contain any inputs specific to the search algorithm.
- Returns:
A new GlobalSearch object.
- Return type:
- abstract startSearch(lb, ub)
Begin a new global search.
- Parameters:
lb (ndarray) – A 1D array of lower bounds for the design space.
ub (ndarray) – A 1D array of upper bounds for the design space.
- Returns:
A 2D design matrix.
- Return type:
ndarray
- resumeSearch()
Resume a global search.
- Returns:
A 2D design matrix.
- Return type:
ndarray
- save(filename)
Save important data from this class so that it can be reloaded.
Note: If this function is left unimplemented, ParMOO will reinitialize a fresh instance after a save/load. If this is the desired behavior, then this method and the load method need not be implemented.
- Parameters:
filename (string) – The relative or absolute path to the file where all reload data should be saved.
- load(filename)
Reload important data into this class after a previous save.
Note: If this function is left unimplemented, ParMOO will reinitialize a fresh instance after a save/load. If this is the desired behavior, then this method and the save method need not be implemented.
- Parameters:
filename (string) – The relative or absolute path to the file where all reload data has been saved.
Latin Hypercube Sampling
Implementations of the GlobalSearch class.
This module contains implementations of the GlobalSearch ABC, which are based on the Latin hypercube design.
- The classes include:
LatinHypercube– Latin hypercube sampling
- class searches.latin_hypercube.LatinHypercube(m, lb, ub, hyperparams)
Implementation of a Latin hypercube search.
This GlobalSearch strategy uses a Latin hypercube design to sample in the design space.
- __init__(m, lb, ub, hyperparams)
Constructor for the LatinHypercube GlobalSearch class.
- Parameters:
m (int) – The number of simulation outputs (unused by this class).
lb (numpy.ndarray) – A 1d array of lower bounds for the design region. The number of design variables is inferred from the dimension of lb.
ub (numpy.ndarray) – A 1d array of upper bounds for the design region. The dimension must match ub.
hyperparams (dict) –
A dictionary of hyperparameters for the LatinHypercube design. It may contain:
search_budget (int): The sim eval budget for the search
- Returns:
A new LatinHypercube object.
- Return type:
- startSearch(lb, ub)
Begin a new Latin hypercube sampling.
- Parameters:
lb (numpy.ndarray) – A 1d array of lower bounds for the design region. The dimension must match n.
ub (numpy.ndarray) – A 1d array of upper bounds for the design region. The dimension must match n.
- Returns:
A 2d array, containing the list of design points to be evaluated.
- Return type:
np.ndarray
- resumeSearch()
Resume a previous Latin hypercube sampling.
- Returns:
A 2d array, containing the list of design points to be evaluated.
- Return type:
np.ndarray