-
Notifications
You must be signed in to change notification settings - Fork 69
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
MAP-CMA (PPSN2024) #186
Merged
Merged
MAP-CMA (PPSN2024) #186
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,7 +243,7 @@ Source code is also available [here](./examples/cmaes_with_margin.py). | |
</details> | ||
|
||
|
||
#### CatCMA [Hamano et al. 2024] | ||
#### CatCMA [Hamano et al. 2024a] | ||
CatCMA is a method for mixed-category optimization problems, which is the problem of simultaneously optimizing continuous and categorical variables. CatCMA employs the joint probability distribution of multivariate Gaussian and categorical distributions as the search distribution. | ||
|
||
 | ||
|
@@ -317,6 +317,53 @@ The full source code is available [here](./examples/catcma.py). | |
</details> | ||
|
||
|
||
#### Maximum a Posteriori CMA-ES [Hamano et al. 2024b] | ||
MAP-CMA is a method that is introduced to interpret the rank-one update in the CMA-ES from the perspective of the natural gradient. | ||
The rank-one update derived from the natural gradient perspective is extensible, and an additional term, called momentum update, appears in the update of the mean vector. | ||
|
||
<details> | ||
|
||
<summary>Source code</summary> | ||
|
||
```python | ||
import numpy as np | ||
from cmaes import MAPCMA | ||
|
||
|
||
def rosenbrock(x): | ||
dim = len(x) | ||
if dim < 2: | ||
raise ValueError("dimension must be greater one") | ||
return sum(100 * (x[:-1] ** 2 - x[1:]) ** 2 + (x[:-1] - 1) ** 2) | ||
|
||
|
||
if __name__ == "__main__": | ||
dim = 20 | ||
optimizer = MAPCMA(mean=3 * np.ones(dim), sigma=2.0, momentum_r=dim) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's strange that the optimization on the Rosenbrock function starts from m=3. Please adjust it to m=0.0 and sigma=0.5. The sigma setting is to avoid local optima and make the check easier. |
||
print(" evals f(x)") | ||
print("====== ==========") | ||
|
||
evals = 0 | ||
while True: | ||
solutions = [] | ||
for _ in range(optimizer.population_size): | ||
x = optimizer.ask() | ||
value = rosenbrock(x) | ||
evals += 1 | ||
solutions.append((x, value)) | ||
if evals % 1000 == 0: | ||
print(f"{evals:5d} {value:10.5f}") | ||
optimizer.tell(solutions) | ||
|
||
if optimizer.should_stop(): | ||
break | ||
``` | ||
|
||
The full source code is available [here](./examples/mapcma.py). | ||
|
||
</details> | ||
|
||
|
||
#### Separable CMA-ES [Ros and Hansen 2008] | ||
|
||
Sep-CMA-ES is an algorithm that limits the covariance matrix to a diagonal form. | ||
|
@@ -455,7 +502,8 @@ We have great respect for all libraries involved in CMA-ES. | |
* [Akiba et al. 2019] [T. Akiba, S. Sano, T. Yanase, T. Ohta, M. Koyama, Optuna: A Next-generation Hyperparameter Optimization Framework, KDD, 2019.](https://dl.acm.org/citation.cfm?id=3330701) | ||
* [Auger and Hansen 2005] [A. Auger, N. Hansen, A Restart CMA Evolution Strategy with Increasing Population Size, CEC, 2005.](http://www.cmap.polytechnique.fr/~nikolaus.hansen/cec2005ipopcmaes.pdf) | ||
* [Hamano et al. 2022] [R. Hamano, S. Saito, M. Nomura, S. Shirakawa, CMA-ES with Margin: Lower-Bounding Marginal Probability for Mixed-Integer Black-Box Optimization, GECCO, 2022.](https://arxiv.org/abs/2205.13482) | ||
* [Hamano et al. 2024] [R. Hamano, S. Saito, M. Nomura, K. Uchida, S. Shirakawa, CatCMA : Stochastic Optimization for Mixed-Category Problems, GECCO, 2024.](https://arxiv.org/abs/2405.09962) | ||
* [Hamano et al. 2024a] [R. Hamano, S. Saito, M. Nomura, K. Uchida, S. Shirakawa, CatCMA : Stochastic Optimization for Mixed-Category Problems, GECCO, 2024.](https://arxiv.org/abs/2405.09962) | ||
* [Hamano et al. 2024b] [R. Hamano, S. Shirakawa, M. Nomura, Natural Gradient Interpretation of Rank-One Update in CMA-ES, PPSN, 2024.](https://arxiv.org/abs/2406.16506) | ||
* [Hansen 2016] [N. Hansen, The CMA Evolution Strategy: A Tutorial. arXiv:1604.00772, 2016.](https://arxiv.org/abs/1604.00772) | ||
* [Nomura et al. 2021] [M. Nomura, S. Watanabe, Y. Akimoto, Y. Ozaki, M. Onishi, Warm Starting CMA-ES for Hyperparameter Optimization, AAAI, 2021.](https://arxiv.org/abs/2012.06932) | ||
* [Nomura et al. 2023] [M. Nomura, Y. Akimoto, I. Ono, CMA-ES with Learning | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to mention that like "The performance of MAP-CMA is not so different from CMA-ES, as the main motivation of MAP-CMA comes from theoretical understanding of CMA-ES".