gmpb
This Python implementation follows the Generalized Moving Peaks Benchmark introduced by Danial Yazdani, Michalis Mavrovouniotis, Changhe Li, Guoyu Chen, Wenjian Luo, Mohammad Nabi Omidvar, Juergen Branke, Shengxiang Yang, and Xin Yao.
gmpb is a small, reusable, MIT-licensed implementation of the fully
non-separable GMPB formulation described in the paper
“Competition on Dynamic Optimization Problems Generated by Generalized Moving
Peaks Benchmark (GMPB)”. The core library intentionally does not depend on or
derive its implementation from the original MATLAB/Octave codebase.
Quick Start
Requires Python 3.10+.
python -m venv .venv
source .venv/bin/activate
make dev
make test
import numpy as np
from gmpb import GMPB, GMPBConfig
config = GMPBConfig(d=5, m=10, change_frequency=5000)
problem = GMPB(config, seed=7)
value = problem.evaluate(np.zeros(config.d))
batch = problem.evaluate_batch(np.random.default_rng(0).normal(size=(32, config.d)))
Public API
The stable import surface for 0.1.x is:
from gmpb import GMPB, GMPBConfig
from gmpb.metrics import end_of_env_error, offline_error
Stepping Semantics
GMPB is a dynamic maximization benchmark. With the default auto_step=True:
- Each scalar or batch evaluation consumes fitness evaluations.
- The
change_frequency-th evaluation is still scored in the current environment. - The benchmark steps immediately after returning the value that consumed the last evaluation in that environment.
evaluate_batch()splits work into chunks when a batch crosses environment boundaries, so each sub-block is scored under the correct environment.
If you want to control environment changes manually, set auto_step=False and
call step_environment() directly.
Metrics
The benchmark does not compute the true optimum value f* for each environment.
You supply those values externally when calculating:
offline_error(f_star, best_so_far)end_of_env_error(f_star, best_end)
Minimization
GMPB is defined as a maximization problem. To use it in a minimization pipeline, negate the returned objective values.
Examples And Docs
Run the minimal example:
make run-example
Build the docs:
make docs
The HTML output is written to docs/_build/html/.
Upstream Compatibility
This repository can optionally validate its installed Python implementation against EDOLAB's Octave GMPB implementation as a test-only oracle. EDOLAB is not a runtime dependency and is never bundled into the package artifacts.
For a local compatibility run, clone EDOLAB into _edolab/, check out the
pinned commit in tests/upstream/EDOLAB_SHA.txt, and run:
make test-upstream-compat
Metadata
Release files for gmpb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gmpb-0.1.0.tar.gz | 17.6 kB | With provenance | Details for gmpb-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gmpb-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for gmpb-0.1.0-py3-none-any.whl |
Total release size: 32.6 kB
Release files / gmpb-0.1.0.tar.gz
| Download URL | gmpb-0.1.0.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
45474891c8818caf287a35a489e9d5cf7a634dbcb411487103ddd864aa9350f5
|
|
BLAKE2b-256 checksum How to use checksums |
6b7cb46f3beed5f0c5f6e06308a89195ff54a2e9e7c41b382c0aa788b0a3c535
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 4, 2026.
Transparency logRelease files / gmpb-0.1.0-py3-none-any.whl
| Download URL | gmpb-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
117f6cf7fe053fe4e5b4d189a020d403023b1efa1d4bf4836a15ff8d5e7242f3
|
|
BLAKE2b-256 checksum How to use checksums |
439c4d3dc18ee0f215c605d4be6db61fdcc24b6787168a692d8d827d4314ca5f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 4, 2026.
Transparency logSecurity for gmpb 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for gmpb-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Mar 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.