pymoo
Latest Version: pymoo==0.4.1

Nelder Mead

This algorithm is implemented based on [6]. 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.so_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.49977236 0.49995608 0.50006502 0.50014803 0.50029494 0.50009887
 0.4992701  0.49963783 0.49968202 0.49961358]
F = [1.09100991e-06]

API

class pymoo.algorithms.so_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