cbx.objectives.Ackley_multimodal#

class cbx.objectives.Ackley_multimodal(alpha=None, z=None)[source]#

Bases: cbx_objective

Multimodal Ackley’s function

Let \(V\) be the Ackley’s function. Then the multimodal Ackley’s function is defined as

\[f(x) = \prod_{i=1}^n V(\alpha_i (x - z_i))\]
Parameters:
  • alpha (list of floats, optional) – The factor for each multiplicative term. The default is [1.0].

  • z (numpy array, optional) – The shift vectors in each term. The default is np.array([[0]]).

Examples

>>> import numpy as np
>>> from cbx.objectives import Ackley_multimodal
>>> x = np.array([[1,2], [3,4], [5,6]])
>>> alpha = [2., 3.]
>>> z = np.array([[2,3], [4,5]])
>>> f = Ackley_multimodal(alpha = alpha, z = z)
>>> f(x)
array([110.07368964,  59.49910362, 126.11721609])

See also

Ackley, Rasrigin_multimodal