Skip to content

Add CMAES optimizer from nevergrad #591

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

gauravmanmode
Copy link
Contributor

@gauravmanmode gauravmanmode commented Apr 23, 2025

Hi @janosg
I am wrapping the CMA-ES optimizer from nevergrad
Will be adding tests and docs shortly.
Referring from the discussion in the existing PR's and issues,
some things I have experimented with are:

  1. Refactor code (use helper function nevergrad_internal to simplify code)
  2. Tried using a custom executor that call problem.batch_fun inside
    Using a CustomExecutor, for time consuming objective functions, benchmarking reveals
    Screenshot from 2025-04-21 11-32-57,
    whereas with lightweight objective functions, n_cores = 1 seemed more preferrable

Is this in the right direction?

@janosg
Copy link
Member

janosg commented Apr 28, 2025

Hi @gauravmanmode, thanks for the PR.

I definitely like the idea of your nevergrad_internal function. We currently have several independent nevergrad PRs open and a function like this is good to avoid code duplication.

Regarding the Executor: There was an argument brought forward by @r3kste that suggests it would be better to use the low-level ask-and-tell interface if we want to support parallelism. While I still think the solution with the custom Executor can be made to work, I think that the ask-and-tell interface is simpler and more readable for this.

@janosg
Copy link
Member

janosg commented Apr 28, 2025

Currently your tests fail because nevergrad is not compatible with numpy 2.0 and higher. You can pin numpy in the environment file for now.

@janosg
Copy link
Member

janosg commented Apr 28, 2025

Or better: Install nevergrad via pip instead of conda. The conda version is outdated. Then you don't need to pin any numpy versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants