Ackley¶
The Ackley function is widely used for testing optimization algorithms. In its two-dimensional form, as shown in the plot above, it is characterized by a nearly flat outer region, and a large hole at the centre. The function poses a risk for optimization algorithms, particularly hillclimbing algorithms, to be trapped in one of its many local minima.
Definition
f(x)=−aexp[−b√1nn∑i=1xi2]−exp[1nn∑i=1cos(cxi)]+a+e,a=20,b=15,c=2π−32.768≤xi≤32.768,i=1…,n
Optimum
f(x∗)=0atx∗=(0,…,0)
Fitness Landscape
[1]:
import numpy as np
from pymoo.problems import get_problem
from pymoo.visualization.fitness_landscape import FitnessLandscape
problem = get_problem("ackley", n_var=2, a=20, b=1/5, c=2 * np.pi)
FitnessLandscape(problem, angle=(45, 45), _type="surface").show()
[1]:
<pymoo.visualization.fitness_landscape.FitnessLandscape at 0x11d9b32f0>

[2]:
FitnessLandscape(problem, _type="contour", colorbar=True).show()
[2]:
<pymoo.visualization.fitness_landscape.FitnessLandscape at 0x11e15f9e0>
