cbx.objectives.Himmelblau#

class cbx.objectives.Himmelblau(factor=1.0)[source]#

Bases: cbx_objective

Himmelblau’s function

Himmelblau’s function is a multimodal function with. The function is defined as

\[f(x,y) = (x^2 + y - 11)^2 + (x + y^2 - 7)^2\]

See Himmelblau’s function.

Parameters:

factor (float, optional) – The factor by which the input is multiplied. The default is 1.0.

Global minima#

  • \(f(x,y) = 0\) at \((x,y) = (3,2)\)

  • \(f(x,y) = 0\) at \((x,y) = (-2.805118,3.131312)\)

  • \(f(x,y) = 0\) at \((x,y) = (-3.779310,-3.283186)\)

  • \(f(x,y) = 0\) at \((x,y) = (3.584428,-1.848126)\)

Examples

>>> import numpy as np
>>> from cbx.objectives import Himmelblau
>>> x = np.array([[1,2], [3,4], [5,6]])
>>> f = Himmelblau()
>>> f(x)
array([  68.,  148., 1556.])

Visualization#

(Source code, png, hires.png, pdf)

../../_images/cbx-objectives-Himmelblau-1.png