NelderMead
The Nelder-Mead simplex algorithm is a local search, gradient-free optimization algorithm. This solver uses the ‘Nelder-Mead’ algorithm from the Scipy library.
Note
NelderMead can solve only bound-constrained problems.
Please use other gradient-free algorithms such as COBYLA or COBYQA
if your problem has constraints other than simple variable bounds.
For better efficiency, we recommend using general nonlinear programming algorithms
such as PySLSQP or IPOPT if first order derivative information is available
for the objective and constraints of your problem.
To use the NelderMead solver, start by importing it as shown in the following code:
from modopt import NelderMead
Options could be set by just passing them within the solver_options dictionary when
instantiating the NelderMead optimizer object.
For example, we can set the maximum number of function evaluations maxiter
and the minimum absolute error in x_best between iterations xatol as shown below.
optimizer = NelderMead(prob, solver_options={'maxiter':1000, 'catol':1e-6})
The options available for the NelderMead solver in modOpt are given in the following table.
For more information on the Scipy ‘Nelder-Mead’ algorithm, visit
Scipy documentation.
Option |
Type (default value) |
Description |
|---|---|---|
|
int ( |
Maximum number of function evaluations. |
|
int ( |
Maximum number of iterations. The optimization will stop as |
|
float ( |
Terminate if absolute error in |
|
float ( |
Terminate if absolute error in |
|
bool ( |
Set to |
|
np.ndarray ( |
Initial simplex coordinates of shape |
|
bool ( |
Set to |
|
bool ( |
Set to |
|
callable ( |
Function to be called after each iteration. The function is |