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

Fix the "center" of CMAES to be 1-dimensional #111

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

engintoklu
Copy link
Collaborator

Addressed issue:
#110

During the initialization of CMAES, the center point of the search was generated not as a vector of length n, but as a tensor of shape (1, n). Because of this, the reported "center" solution in the status dictionary also ended up with an unexpected leftmost dimension with size 1.

This fix introduces a squeeze() operation on the initial center tensor, and also a shape verification, ensuring that the center tensor is 1-dimensional and has a correct length. With these changes, the reported "center" in the status dictionary becomes 1-dimensional.

Addressed issue:
#110

During the initialization of CMAES, the center
point of the search was generated not as a vector
of length `n`, but as a tensor of shape `(1, n)`.
Because of this, the reported "center" solution
in the status dictionary also ended up with an
unexpected leftmost dimension with size 1.

This fix introduces a `squeeze()` operation on
the initial center tensor, and also a shape
verification, ensuring that the center tensor is
1-dimensional and has a correct length.
With these changes, the reported "center" in the
status dictionary becomes 1-dimensional.
@flukeskywalker flukeskywalker merged commit 11b4771 into master Aug 2, 2024
1 of 2 checks passed
@flukeskywalker flukeskywalker deleted the fix/cmaes-status-center branch August 2, 2024 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants