desc.optimize.register_optimizer

class desc.optimize.register_optimizer(name, description, scalar, equality_constraints, inequality_constraints, stochastic, hessian, GPU=False, **kwargs)Source

Decorator to wrap a function for optimization.

Function being wrapped should have a signature of the form fun(objective, constraint, x0, method, x_scale, verbose, stoptol, options=None) and should return a scipy.optimize.OptimizeResult object

Function should take the following arguments:

objectiveObjectiveFunction

Function to minimize.

constraintObjectiveFunction

Constraint to satisfy

x0ndarray

Starting point.

methodstr

Name of the method to use.

x_scalearray_like or ‘jac’, optional

Characteristic scale of each variable.

verboseint
  • 0 : work silently.

  • 1 : display a termination report.

  • 2 : display progress during iterations

stoptoldict

Dictionary of stopping tolerances, with keys {“xtol”, “ftol”, “gtol”, “maxiter”, “max_nfev”}

optionsdict, optional

Dictionary of optional keyword arguments to override default solver settings.

Parameters:
  • name (str or array-like of str) – Name of the optimizer method. If one function supports multiple methods, provide a list of names.

  • description (str or array-like of str) – Short description of the optimizer method, with references if possible.

  • scalar (bool or array-like of bool) – Whether the method assumes a scalar residual, or a vector of residuals for least squares.

  • equality_constraints (bool or array-like of bool) – Whether the method handles equality constraints.

  • inequality_constraints (bool or array-like of bool) – Whether the method handles inequality constraints.

  • stochastic (bool or array-like of bool) – Whether the method can handle noisy objectives.

  • hessian (bool or array-like of bool) – Whether the method requires calculation of the full hessian matrix.

  • GPU (bool or array-like of bool) – Whether the method supports running on GPU