Skip to content

gaetanserre/GOB

Repository files navigation

Global Optimization Benchmark (GOB)

CI CI PyPI version Code style: black

GOB Logo

GOB is a collection of global optimization algorithms implemented in C++ and linked with Python. It also includes a set of analytical benchmark functions and a random function generator (PyGKLS) to test the performance of these algorithms.

Algorithms

Documentation

The documentation is available at gaetanserre.fr/GOB.

Installation (Python ≥ 3.10)

Install the package via pip from PyPI:

pip install gob

Alternatively, download the corresponding wheel file from the releases and install it with pip:

pip install gob-<version>-<architecture>.whl

Build from source

Make sure you have CMake (≥ 3.28), a c++ compiler, and the eigen3 library installed. Then clone the repository and run:

pip install . -v

It should build the C++ extensions and install the package. You can also build the documentation with:

cd docs
pip install -r requirements.txt
make html

Usage

This package can be used to design a complete benchmarking framework for global optimization algorithms, testing multiple algorithms on a set of benchmark functions. See test_gob.py for an example of how to use it.

The global optimization algorithms can also be used independently. For example, to run the AdaLIPO+ algorithm on a benchmark function:

from gob.optimizers import AdaLIPO_P
from gob import create_bounds

f = lambda x: return x.T @ x

opt = AdaLIPO_P(create_bounds(2, -5, 5), 300)
res = opt.minimize(f)
print(f"Optimal point: {res[0]}, Optimal value: {res[1]}")

See test_optimizers.py for more examples of how to use the algorithms.

Contributing

Contributions are welcome! Please see the CONTRIBUTING file for guidelines.

References

License

This project is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0). See the LICENSE file for details.

About

GOB is a collection of global optimization algorithms implemented in C++ and linked with Python.

Resources

License

Contributing

Stars

Watchers

Forks

Contributors