genopt⚓︎
Non-Gaussian generalisation of EnOpt: the sampling distribution adapts as well.
GenOpt
⚓︎
Bases: OptimizerBase
Generalized ensemble optimization with an adapting mutation distribution.
EnOpt draws its ensemble from a Gaussian whose covariance is fixed apart from an
optional Hessian-driven update. GenOpt draws from the marginals of
:class:~popt.ensembles.ensemble_generalized.GeneralizedEnsemble -- Beta,
logistic, truncated Gaussian -- and moves the distribution itself along with the
controls: theta (the marginal's shape) follows its own gradient, and the
correlation matrix follows corr_adapt.
So each accepted step updates three things rather than one: the controls from
jac, theta from jac_mut, and corr from corr_adapt -- which is
either a :class:CMA instance, called with the ensemble the mutation gradient
was built from, or any callable returning a matrix to descend along.
Examples:
ensemble = GeneralizedEnsemble(options, simulator, objective)
cma = CMA(ne=ensemble.num_samples, dim=x0.size, corr_update=True)
result = GenOpt.minimize(
x0, ensemble.function,
jac=ensemble.gradient, jac_mut=ensemble.mutation_gradient,
args=(ensemble.get_theta(), ensemble.get_corr()),
corr_adapt=cma, bounds=bounds,
)
__init__(x0, fun, jac=None, jac_mut=None, corr_adapt=None, args=(), bounds=None, callback=None, **options)
⚓︎
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x0
|
ndarray
|
Initial control vector. |
required |
fun
|
callable
|
Objective function. |
required |
jac
|
callable
|
Ensemble gradient, called as |
None
|
jac_mut
|
callable
|
Mutation gradient, called as |
None
|
corr_adapt
|
CMA or callable
|
Correlation-matrix adaptation. A :class: |
None
|
args
|
tuple
|
|
()
|
bounds
|
sequence
|
(min, max) per control. |
None
|
callback
|
callable
|
Invoked after each accepted step. |
None
|
**options
|
GenOpt configuration, plus everything :class:
|
{}
|
log_columns()
⚓︎
Iteration, backtracking attempts, objective, step size, and the correlation's spread.
update_step()
⚓︎
One GenOpt step: controls by backtracking, then theta and the correlation.