SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.01373 · 2024

cmaes: A Simple yet Practical Python Library for CMA-ES

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 2 violated it and 4 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2402.01373.json · badge: /api/ran/2402.01373.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
CyberAgentAILab/cmaes canonical (classifier label)
classifier basis: classifier_2025
4 ran · 0 no recorded run
CyberAgent/cmaes community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
DSIntLFTL Ran
ran, violated the contract we drafted
CyberAgentAILab/cmaes/examples/como_catcma_with_margin.py
code served (permissive licence) · get_code("17c224ee4188ad08")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Analyze the function to understand parameter requirements:
# - x: used with len(x) and division/squaring, so numeric array
# - z: used with len(z) and division/squaring, so numeric array
# - c: used with .argmax(axis=1), .cumprod(), and len(c), so 2D array
# - cat_num: used as np.asarray(cat_num) - 1, so array-like

# Create small test data
x = np.array([1.0, 2.0, 3.0, 4.0])  # 1D array for Sphere calculations
z = np.array([0.5, 1.5, 2.5, 3.5])  # 1D array for SphereInt calculations
c = np.array([[0.9, 0.1],           # 2D array with shape (4, 2) for argmax(axis=1)
              [0.3, 0.7],
              [0.2, 0.8],
              [0.1, 0.9]])
cat_num = np.array([2])  # Array-like, used as cat_num - 1

ARGS = {
    "x": x,
    "z": z,
    "c": c,
    "cat_num": cat_num
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SphereCOM Ran
ran, honoured the contract we drafted
CyberAgentAILab/cmaes/examples/catcma_with_margin.py
code served (permissive licence) · get_code("5cf4fb16896b84c2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - x: used as sum(x * x), so needs to support element-wise multiplication and summing
# - c: used as len(c) and c[:, 0], so needs to be indexable with 2D structure
# Both appear to be tensors or array-like objects

x = torch.randn(2, 4)  # Small tensor: batch 2, dim 4
c = torch.randn(3, 4)  # 2D tensor where we can index c[:, 0]

ARGS = {
    "x": x,
    "c": c
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SphereInt Ran
ran on a synthesized input
CyberAgentAILab/cmaes/examples/catcma_with_margin.py
code served (permissive licence) · get_code("3a87377b68d18050")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# SphereInt takes two parameters: x and z
# The function does: sum(x * x) + sum(z * z)
# This means x and z should be iterables (lists, arrays, or tensors) that support multiplication and sum()

# Create small tensor arguments
x = torch.randn(4)
z = torch.randn(4)

ARGS = {
    "x": x,
    "z": z
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SphereIntCOM Ran
ran, violated the contract we drafted
CyberAgentAILab/cmaes/examples/catcma_with_margin.py
code served (permissive licence) · get_code("1a2fdf767fb6e0d9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - x: used with sum(x * x), so needs to support multiplication and sum
# - z: used with sum(z * z), so needs to support multiplication and sum
# - c: used with len(c) and c[:, 0], so needs to be indexable with 2D structure

# x and z can be torch tensors or numpy arrays
# c needs to be 2D and support indexing like c[:, 0]

x = torch.randn(4)
z = torch.randn(4)
c = torch.randn(2, 3)

ARGS = {
    'x': x,
    'z': z,
    'c': c
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
chi2_ppf Ran
ran on a synthesized input
CyberAgent/cmaes/cmaes/_stats.py
code served (permissive licence) · get_code("664c072746c42ffd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math
import numpy as np

# The function chi2_ppf is vectorized and takes a single float parameter q
# We need to provide a numpy array or scalar that will be vectorized over

ARGS = {
    "q": np.array([0.0, 0.5, 0.9, 0.99, 1.0])
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_warm_start_mgd Ran
ran on a synthesized input
CyberAgent/cmaes/cmaes/_warm_start.py
code served (permissive licence) · get_code("f59a4e4c50025f59")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import math

# Create source solutions: list of (parameter_vector, value) tuples
# Using small dimension (4) for parameters
dim = 4
num_solutions = 10

# Create random parameter vectors and corresponding objective values
source_solutions = []
for i in range(num_solutions):
    param = np.random.randn(dim)
    value = float(np.random.rand())  # Random objective value
    source_solutions.append((param, value))

ARGS = {
    "source_solutions": source_solutions,
    "gamma": 0.1,
    "alpha": 0.1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
norm_cdf Ran
ran on a synthesized input
CyberAgent/cmaes/cmaes/_stats.py
code served (permissive licence) · get_code("21b3e0a118e9880e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (4,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math
import numpy as np
import torch

# The function norm_cdf is a numpy-vectorized function that computes
# the cumulative distribution function of a normal distribution.
# It takes x (the value), loc (mean), and scale (standard deviation) as parameters.

# Since the function is decorated with @np.vectorize, it can accept:
# - scalar floats
# - numpy arrays
# - any array-like objects that numpy can broadcast

# Create test inputs
torch.manual_seed(0)

# Create various input types to test the vectorized function
x_scalar = 0.5
x_array = np.array([0.0, 1.0, -1.0, 2.0])
x_tensor = torch.tensor([0.5, 1.5, -0.5, 2.5], dtype=torch.float32)

# Convert tensor to numpy for compatibility
x_tensor_np = x_tensor.numpy()

# Define parameters for the normal distribution
loc_scalar = 0.0
loc_array = np.array([0.0, 0.5, -0.5, 1.0])

scale_scalar = 1.0
scale_array = np.array([1.0, 1.5, 0.5, 2.0])

# Build ARGS dictionary with all combinations
# Since the function is vectorized, we test with arrays
ARGS = {
    "x": x_array,
    "loc": loc_scalar,
    "scale": scale_scalar,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (4,) — shape (4,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The covariance matrix adaptation evolution strategy (CMA-ES) has been highly effective in black-box continuous optimization, as demonstrated by its success in both benchmark problems and various real-world applications. To address the need for an accessible and powerful tool in this domain, we developed cmaes, a simple and practical Python library for CMA-ES. cmaes is characterized by its simplicity, offering intuitive use and high code readability. This makes it suitable for quick use of CMA-ES, as well as for educational purposes and seamless integration into other libraries. Despite its simple design, cmaes maintains advanced functionality. It incorporates recent advancements in CMA-ES, such as learning rate adaptation for challenging scenarios, transfer learning, mixed-variable optimization, and multi-objective optimization capabilities. These advanced features are accessible through a user-friendly API, ensuring that cmaes can be easily adopted in practical applications. We present cmaes as a strong candidate for a practical Python CMA-ES library aimed at practitioners. The software is available under the MIT license at https://github.com/CyberAgentAILab/cmaes.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2402.01373")
get_code_for_paper("2402.01373")
have("2402.01373")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2402.01373.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2402.01373.svg)](https://syntology.ai/paper/2402.01373)

Connect an agent — have() is free.