moptipy.examples.vectors package¶
Examples for continuous vector-based objective functions. Ackley’s Function. Ackley’s function is a continuous, multimodal, differentiable, non-separable, and scalable benchmark function for continuous optimization. David H. Ackley. A Connectionist Machine for Genetic Hillclimbing. 1987. Volume 28 of The Kluwer International Series in Engineering and Computer Science. Norwell, MA, USA: Kluwer Academic Publisher. ISBN: 978-1-4612-9192. doi:10.1007/978-1-4613-199 Compute Ackley’s function. The well-known sphere function. Bases: The well-known sphere function. Get the sum of the squares of the elements in an array. x ( the sum of the squares of all elementsSubmodules¶
moptipy.examples.vectors.ackley module¶
>>> from numpy import array
>>> print(ackley(array([0.0, 0.0, 0.0])))
0.0
>>> ackley(array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0]))
0.0
>>> print(abs(ackley(array([0.0, 0.0, 0.0]))) < 1e-15)
True
>>> print(ackley(array([2.0, 2.0])))
6.593599079287213
>>> print(ackley(array([-3.0, 2.0])))
7.9889108105187
moptipy.examples.vectors.sphere module¶
Objective
ndarray
) – the np array>>> print(sphere(np.array([1.0, -2.0, 3.0])))
14.0
>>> print(sphere(np.array([0.0, 0.0, 0.0])))
0.0