GOB

GOB is also a toolbox for benchmarking and comparing global optimization algorithms over a suite of test functions. It provides a standardized framework to evaluate the performance of various optimizers using different metrics. The benchmarking suite consists of a class GOB that takes as input a list of optimizers, a list of benchmark functions, a list of metrics, and the bounds for the optimization problems. The run method executes the optimization algorithms on the benchmark functions for a specified number of runs and computes the performance metrics.

class gob.gob.GOB(optimizers, benchmarks, metrics, bounds=None, options={})

Bases: object

Global Optimization Benchmarks.

competitive_ratio(res_dict, min_dict)

Compute the competitive ratio: \(\frac{1}{|F|}\sum\limits_{f \in F} \frac{\text{approx}(f)}{\min_x f(x)}\).

Parameters:
  • res_dict (dict) – The results dictionary.

  • min_dict (dict) – The minimum values of the benchmarks.

  • benchmarks (List Object) – The benchmarks.

Returns:

A dict of competitive ratios.

Return type:

dict

parse_benchmark(benchmark)

Parse the benchmark.

Parameters:

benchmark (str) – The benchmark to use.

Returns:

Instance of the benchmark.

Return type:

Benchmark

parse_metric(metric, benchmark, bounds, options={})

Parse the metric.

Parameters:
  • metric (str | Object) – The metric to use.

  • benchmark (Benchmark) – The benchmark function.

  • bounds (array-like of shape (n_variables, 2)) – The bounds of the search space.

  • options (dict of keyword arguments) – The options for the metric.

Returns:

Instance of the metric.

Return type:

List Metric

parse_optimizer(optimizer, bounds)

Parse the optimizer.

Parameters:
  • optimizer (tuple(str | class, dict) | str | Object) – The optimizer to use.

  • bounds (array-like of shape (n_variables, 2)) – The bounds of the search space.

Returns:

Instance of the optimizer.

Return type:

Optimizer

run(n_runs=1, verbose=0)

Run the benchmark.

Parameters:
  • n_runs (int) – The number of runs to perform.

  • verbose (int) – The verbosity level.