Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal] Support 1D search space in CMA-ES #190

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmaes/_cma.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __init__(
), f"Abs of all elements of mean vector must be less than {_MEAN_MAX}"

n_dim = len(mean)
assert n_dim > 1, "The dimension of mean must be larger than 1"
assert n_dim > 0, "The dimension of mean must be positive"

if population_size is None:
population_size = 4 + math.floor(3 * math.log(n_dim)) # (eq. 48)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_fuzzing.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TestFuzzing(unittest.TestCase):
data=st.data(),
)
def test_cma_tell(self, data):
dim = data.draw(st.integers(min_value=2, max_value=100))
dim = data.draw(st.integers(min_value=1, max_value=100))
mean = data.draw(npst.arrays(dtype=float, shape=dim))
sigma = data.draw(st.floats(min_value=1e-16))
n_iterations = data.draw(st.integers(min_value=1))
Expand Down
Loading