Skip to content

enopt⚓︎

Ensemble optimization methods compatible with OptimizerBase.

EnOpt ⚓︎

Bases: OptimizerBase

Ensemble-based optimization (EnOpt).

obj_func_values ⚓︎

Legacy alias for fk.

__init__(x0, fun, jac=None, hess=None, args=(), bounds=None, callback=None, **options) ⚓︎

Initialize an EnOpt optimizer instance.

Parameters:

Name Type Description Default
x0 ndarray

Initial control/state vector.

required
fun callable

Objective function.

required
jac callable

Ensemble gradient function.

None
hess callable

Ensemble Hessian function.

None
args tuple

The first tuple element is interpreted as the initial covariance.

()
bounds sequence

Lower and upper bounds for each state variable.

None
callback callable

Callback invoked after successful updates.

None
**options

EnOpt configuration, plus everything :class:OptimizerBase takes. - tol: Convergence tolerance for objective improvement (default: 1e-6). Also used as ftol when given. - step_size: Initial optimizer step size. Overrides alpha when provided. - alpha: Initial optimizer step size (default: 0.1). - alpha_cov: Covariance update scaling factor (default: 0.001). - beta: Momentum parameter used in the optimizer and optional Nesterov updates (default: 0.0). - nesterov: Whether to evaluate search quantities with Nesterov momentum (default: False). - alpha_maxiter: Maximum number of backtracking trials per iteration (default: 5). - resample: Number of covariance resampling attempts if no improvement is found (default: 0). - hessian: Whether to use the Hessian in the search direction computation (default: False). - normalize: Whether to normalize the gradient or Hessian-derived search quantities (default: True). - cov_factor: Covariance shrink factor applied during resampling (default: 0.5). - optimizer: Update rule name. Supported values are GD, Adam, AdaMax, and Steihaug (default: GD).

{}

log_columns() ⚓︎

The row of the iteration log: iteration, backtracking attempts, objective, step size, first covariance entry.

update_step() ⚓︎

Perform one EnOpt step with backtracking and optional resampling.