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(n_max_restarts=10)
res = minimize(problem,
algorithm,
seed=1,
verbose=False)
print(res.X)
print(res.F)
[0.49955771 0.49951863 0.50041486 0.49977682 0.50047266 0.50000158
0.50030921 0.50048091 0.49992482 0.49986138]
[1.22442015e-06]
API¶
-
class
pymoo.algorithms.so_nelder_mead.
NelderMead
(self, X=None, func_params=adaptive_params, n_max_local_restarts=0, criterion_local_restart=NelderAndMeadTermination(xtol=1e-2, ftol=1e-2), 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.
- n_max_local_restartsint
This algorithm employs local restarts by starting with a new initial simplex. This can be turned of by setting it to 0.
- criterion_local_restartTermination
Provide a termination object which decides whether a local restart should be performed or not.
Methods
initialize_simplex