PyGKLS¶

Uses the pyGKLS package to generate random test functions, with control over their geometry.
- class gob.benchmarks.pygkls.PyGKLS(dim, num_minima, domain, global_min, global_dist=None, global_radius=None, gen=None, smoothness='D')¶
Bases:
Benchmark
- expr(x)¶
The expression of the function.
- Parameters:
x (array-like) – The point at which to evaluate the function.
- Returns:
The value of the function at x.
- Return type:
float
- gradient(x)¶
Estimate the gradient of a function at a given point using finite differences.
- Parameters:
f (callable) – The function to estimate the gradient of. It should take a single argument.
x (array-like) – The point at which to estimate the gradient of f.
eps (float, optional) – The perturbation used to estimate the gradient.
- Returns:
The estimated gradient of f at x and the value of f at x.
- Return type:
pair