ensemble_base⚓︎
Base ensemble for optimisation: the control vector as state, objective evaluation over the members, and multilevel bookkeeping.
EnsembleOptimizationBase
⚓︎
Bases: BaseEnsemble
Base class for the popt ensemble
finest_level
⚓︎
Index of the finest (highest-fidelity) level, the last one in en_size.
num_levels
⚓︎
Number of fidelity levels: the length of en_size, or 1 without multilevel.
__init__(options, simulator, objective)
⚓︎
function(x, *args, level=None, **kwargs)
⚓︎
Evaluate objective values for a single state vector or an ensemble.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
ndarray
|
Control vector with shape |
required |
level
|
int
|
Fidelity level to simulate on, for a multilevel ensemble ( |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
Objective function values, or |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
get_bounds()
⚓︎
Returns:
| Name | Type | Description |
|---|---|---|
bounds |
list
|
(min, max) pairs for each element in x. None is used to specify no bound. |
get_cov()
⚓︎
Returns:
| Name | Type | Description |
|---|---|---|
cov |
ndarray
|
Covariance matrix, shape (number of controls, number of controls) |
get_state()
⚓︎
Returns:
| Name | Type | Description |
|---|---|---|
x |
ndarray
|
Control vector as ndarray, shape (number of controls, number of perturbations) |
levels_with_members(x)
⚓︎
Indices of the levels that x (a matrix, or a per-level list) puts members on.