A Python implementation of the Generalized Moving Peaks Benchmark
Project description
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gmpb-0.1.0.tar.gz.
File metadata
- Download URL: gmpb-0.1.0.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45474891c8818caf287a35a489e9d5cf7a634dbcb411487103ddd864aa9350f5
|
|
| MD5 |
0d2f88b5b018c55a3f21ee56be4a8dba
|
|
| BLAKE2b-256 |
6b7cb46f3beed5f0c5f6e06308a89195ff54a2e9e7c41b382c0aa788b0a3c535
|
Provenance
The following attestation bundles were made for gmpb-0.1.0.tar.gz:
Publisher:
workflow.yml on cmudrc/gmpb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gmpb-0.1.0.tar.gz -
Subject digest:
45474891c8818caf287a35a489e9d5cf7a634dbcb411487103ddd864aa9350f5 - Sigstore transparency entry: 1021400169
- Sigstore integration time:
-
Permalink:
cmudrc/gmpb@04a095547070de9ed35f7671139e9e898d576dfc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cmudrc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@04a095547070de9ed35f7671139e9e898d576dfc -
Trigger Event:
push
-
Statement type:
File details
Details for the file gmpb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gmpb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
117f6cf7fe053fe4e5b4d189a020d403023b1efa1d4bf4836a15ff8d5e7242f3
|
|
| MD5 |
f650e2de4667aa7dc78d98f14909a155
|
|
| BLAKE2b-256 |
439c4d3dc18ee0f215c605d4be6db61fdcc24b6787168a692d8d827d4314ca5f
|
Provenance
The following attestation bundles were made for gmpb-0.1.0-py3-none-any.whl:
Publisher:
workflow.yml on cmudrc/gmpb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gmpb-0.1.0-py3-none-any.whl -
Subject digest:
117f6cf7fe053fe4e5b4d189a020d403023b1efa1d4bf4836a15ff8d5e7242f3 - Sigstore transparency entry: 1021400239
- Sigstore integration time:
-
Permalink:
cmudrc/gmpb@04a095547070de9ed35f7671139e9e898d576dfc -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/cmudrc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@04a095547070de9ed35f7671139e9e898d576dfc -
Trigger Event:
push
-
Statement type: