Optimizers¶
Utilities for exploiting active subspaces when optimizing.
-
class
active_subspaces.optimizers.
BoundedMinVariableMap
(domain)¶ This subclass is a MinVariableMap for bounded simulation inputs.
See also
optimizers.MinVariableMap
,optimizers.UnboundedMinVariableMap
-
regularize_z
(Y, N=1)¶ Train the global quadratic for the regularization.
Parameters: - Y (ndarray) – N-by-n matrix of points in the space of active variables
- N (int, optional) – merely there satisfy the interface of regularize_z. It should not be anything other than 1
Returns: Z – N-by-(m-n)-by-1 matrix that contains a value of the inactive variables for each value of the inactive variables
Return type: ndarray
Notes
In contrast to the regularize_z in BoundedActiveVariableMap and UnboundedActiveVariableMap, this implementation of regularize_z uses a quadratic program to find a single value of the inactive variables for each value of the active variables.
-
-
class
active_subspaces.optimizers.
MinVariableMap
(domain)¶ ActiveVariableMap for optimization
This subclass is an domains.ActiveVariableMap specifically for optimization.
See also
optimizers.BoundedMinVariableMap
,optimizers.UnboundedMinVariableMap
Notes
This class’s train function fits a global quadratic surrogate model to the n+2 active variables—two more than the dimension of the active subspace. This quadratic surrogate is used to map points in the space of active variables back to the simulation parameter space for minimization.
-
train
(X, f)¶ Train the global quadratic for the regularization.
Parameters: - X (ndarray) – input points used to train a global quadratic used in the regularize_z function
- f (ndarray) – simulation outputs used to train a global quadratic in the regularize_z function
-
-
class
active_subspaces.optimizers.
UnboundedMinVariableMap
(domain)¶ This subclass is a MinVariableMap for unbounded simulation inputs.
See also
optimizers.MinVariableMap
,optimizers.BoundedMinVariableMap
-
regularize_z
(Y, N=1)¶ Train the global quadratic for the regularization.
Parameters: - Y (ndarray) – N-by-n matrix of points in the space of active variables
- N (int, optional) – merely there satisfy the interface of regularize_z. It should not be anything other than 1
Returns: Z – N-by-(m-n)-by-1 matrix that contains a value of the inactive variables for each value of the inactive variables
Return type: ndarray
Notes
In contrast to the regularize_z in BoundedActiveVariableMap and UnboundedActiveVariableMap, this implementation of regularize_z uses a quadratic program to find a single value of the inactive variables for each value of the active variables.
-
-
active_subspaces.optimizers.
av_minimize
(avfun, avdom, avdfun=None)¶ Minimize a response surface on the active variables.
Parameters: - avfun (function) – a function of the active variables
- avdom (ActiveVariableDomain) – information about the domain of avfun
- avdfun (function) – returns the gradient of avfun
Returns: - ystar (ndarray) – the estimated minimizer of avfun
- fstar (float) – the estimated minimum of avfun
See also
optimizers.interval_minimize()
,optimizers.zonotope_minimize()
,optimizers.unbounded_minimize()
-
active_subspaces.optimizers.
interval_minimize
(avfun, avdom)¶ Minimize a response surface defined on an interval.
Parameters: - avfun (function) – a function of the active variables
- avdom (ActiveVariableDomain) – contains information about the domain of avfun
Returns: - ystar (ndarray) – the estimated minimizer of avfun
- fstar (float) – the estimated minimum of avfun
See also
optimizers.av_minimize()
Notes
This function wraps the scipy.optimize function fminbound.
-
active_subspaces.optimizers.
minimize
(asrs, X, f)¶ Minimize a response surface constructed with the active subspace.
Parameters: - asrs (ActiveSubspaceResponseSurface) – a trained response_surfaces.ActiveSubspaceResponseSurface
- X (ndarray) – input points used to train the MinVariableMap
- f (ndarray) – simulation outputs used to train the MinVariableMap
Returns: - xstar (ndarray) – the estimated minimizer of the function modeled by the ActiveSubspaceResponseSurface asrs
- fstar (float) – the estimated minimum of the function modeled by asrs
Notes
This function has two stages. First it uses the scipy.optimize package to minimize the response surface of the active variables. Then it trains a MinVariableMap with the given input/output pairs, which it uses to map the minimizer back to the space of simulation inputs.
This is very heuristic.
-
active_subspaces.optimizers.
unbounded_minimize
(avfun, avdom, avdfun)¶ Minimize a response surface defined on an unbounded domain.
Parameters: - avfun (function) – a function of the active variables
- avdom (ActiveVariableDomain) – contains information about the domain of avfun
- avdfun (function) – returns the gradient of avfun
Returns: - ystar (ndarray) – the estimated minimizer of avfun
- fstar (float) – the estimated minimum of avfun
See also
optimizers.av_minimize()
Notes
If the gradient avdfun is None, this function wraps the scipy.optimize implementation of SLSQP. Otherwise, it wraps BFGS.
-
active_subspaces.optimizers.
zonotope_minimize
(avfun, avdom, avdfun)¶ Minimize a response surface defined on a zonotope.
Parameters: - avfun (function) – a function of the active variables
- avdom (ActiveVariableDomain) – contains information about the domain of avfun
- avdfun (function) – returns the gradient of avfun
Returns: - ystar (ndarray) – the estimated minimizer of avfun
- fstar (float) – the estimated minimum of avfun
See also
optimizers.av_minimize()
Notes
This function wraps the scipy.optimize implementation of SLSQP with linear inequality constraints derived from the zonotope.