Explanation of Differential Evolution
Diffent approches to candidate calculation
And development
works best on real numbers
does not require continuous space
on those cases works better than GA
from wiki
(drawing placeholder)
from scipy.optimize import differential_evolution
import numpy as np
def ackley(x):
arg1 = -0.2 * np.sqrt(0.5 * (x[0] ** 2 + x[1] ** 2))
arg2 = 0.5 * (np.cos(2. * np.pi * x[0]) + np.cos(2. * np.pi * x[1]))
return -20. * np.exp(arg1) - np.exp(arg2) + 20. + np.e
bounds = [(-5, 5), (-5, 5)]
result = differential_evolution(ackley, bounds)
result.x, result.fun