Nelder Mead¶
This algorithm is implemented based on [16]. In addition to other implementations, a boundary check is included. This ensures that the search considers the box constraints of the given optimization problem. If no boundaries are provided the algorithm falls back to a search without any constraints.
[1]:
from pymoo.algorithms.soo.nonconvex.nelder_mead import NelderMead
from pymoo.factory import get_problem
from pymoo.optimize import minimize
problem = get_problem("sphere")
algorithm = NelderMead()
res = minimize(problem,
algorithm,
seed=1,
verbose=False)
print("Best solution found: \nX = %s\nF = %s" % (res.X, res.F))
Best solution found:
X = [0.49970504 0.50032252 0.49980585 0.50021369 0.50037044 0.50000864
0.50015071 0.49993865 0.49947248 0.49947401]
F = [9.93095286e-07]
API¶
-
class
pymoo.algorithms.soo.nonconvex.nelder_mead.
NelderMead
(self, func_params=adaptive_params, display=SingleObjectiveDisplay(), **kwargs) - Parameters
- Xnp.array or Population
The initial point where the search should be based on or the complete initial simplex (number of dimensions plus 1 points). The population objective can be already evaluated with objective space values. If a numpy array is provided it is evaluated by the algorithm. By default it is None which means the search starts at a random point.
- func_paramsfunc
A function that returns the parameters alpha, beta, gamma, delta for the search. By default:
>>> def adaptive_params(problem): ... n = problem.n_var ... ... alpha = 1 ... beta = 1 + 2 / n ... gamma = 0.75 - 1 / (2 * n) ... delta = 1 - 1 / n ... return alpha, beta, gamma, delta
It can be overwritten if necessary.
- criterion_local_restartTermination
Provide a termination object which decides whether a local restart should be performed or not.
Methods
initialize_simplex