benchmarkfcns.weierstrass¶
- benchmarkfcns.weierstrass(x: Annotated[numpy.typing.NDArray[numpy.float64], '[m, n]', 'flags.c_contiguous'], a: SupportsFloat | SupportsIndex = 0.5, b: SupportsFloat | SupportsIndex = 3.0, kmax: SupportsInt | SupportsIndex = 20) Annotated[numpy.typing.NDArray[numpy.float64], '[m, 1]']¶
- Computes the value of the Weierstrass benchmark function.
Properties:
Global minimum: 0
Location of global minimum: 0
Number of dimensions: n
Domain: [-0.5, 0.5]^n
Number of global minima: 1
Convexity: non-convex
Separability: separable
Modality: multi-modal
Symmetry: The function is symmetric with respect to its input dimensions. The
outer summation treats each dimension of x independently and identically, so permuting the elements of the input vector x (e.g., swapping x1 and x2) will not change the output of the function.
- Inputs:
x: A matrix where each row is a vector of dimension n. a: A scalar parameter that controls the amplitude of the cosine waves. For the
function to be nowhere differentiable, this parameter must satisfy the condition 0<a<1.
- b: A scalar parameter that controls the frequency of the cosine waves. For the
function to be nowhere differentiable, this parameter must be a positive odd integer. The original condition for non-differentiability is that ab>1.
- kmax: An integer that defines the number of terms in the summation. In the
original, theoretical Weierstrass function, this summation goes to infinity. In practical, computable versions like this one, it is truncated at a finite value, kmax. A larger kmax makes the function more “crinkly” and complex.
- Outputs:
- scores: A column vector where each element is the function value at the
corresponding row of x.
Mathematical Definition
Visualization