-
-
Notifications
You must be signed in to change notification settings - Fork 663
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
Add a Nevergrad Sweeper plugin #430
Conversation
This pull request introduces 1 alert when merging c5c92df into 4106845 - view on LGTM.com new alerts:
|
This is awesome, thanks for taking the time to do this.
I did not take a close look at the rest of it, but overall it looks good and a great start. cc @shagunsodhani, when you get some energy after the long Ax stretch - you might want to take this plugin on and polish it a bit. |
|
By the way, check this up: Coming to OmegaConf 2.0 near you soon. :) |
The simplified syntax is more readable and less error prone so that will be nice ;)
|
Looking at your config reminded me of that idea. Re-download: By the way: generally I use typing in Hydra by importing specific things: from typing import Dict, Any, List |
it was there before so I did not dare remove it (google it it seemed it removes some checks)
I can change that if you want. FYI I was doing the same before in nevergrad, and I'm currently in the process of moving to There seems to be some mypy errors. Some are not related to the plugin, but some do, including not finding nevergrad which I should investigate. I never actually checked that the the typing was packaged properly (supposedly it does since there is a |
So, the mypy issue is a bit weird to me. It does look like the Can you see any reason why it would fail to find nevergrad in the CI? |
Comment: # noinspection PyUnresolvedReferences
from hydra.test_utils.test_utils import TSweepRunner, sweep_runner # noqa: F401 Import typing as tp: py.typed: Looking at the lint in the noxfile, it does not install the plugins (so the dependencies are not installed as well). |
I'm still avoiding it given the mobile connection
Got it :D
That's your call, I'll update it (took me a year to change to
Yes. Does it have to be exactly the line above? If so then I'm stuck with the isort/black incompatibility. If not I keep it on the very top and everything is fine |
I've added a seed to avoid flakiness. I would have expected this should not happen often at all (I hoped never), too bad :( |
...ra_nevergrad_sweeper/hydra_plugins/hydra_nevergrad_sweeper/conf/hydra/sweeper/nevergrad.yaml
Show resolved
Hide resolved
plugins/hydra_nevergrad_sweeper/hydra_plugins/hydra_nevergrad_sweeper/core.py
Show resolved
Hide resolved
plugins/hydra_nevergrad_sweeper/hydra_plugins/hydra_nevergrad_sweeper/core.py
Outdated
Show resolved
Hide resolved
It's not too bad. I think some randomness is those algorithms by default is actually a good thing. locking the test with a seed seems like a good solution to me. |
plugins/hydra_nevergrad_sweeper/hydra_plugins/hydra_nevergrad_sweeper/core.py
Show resolved
Hide resolved
The output of a run looks like: | ||
The initialization of the sweep and the first 5 evaluations (out of 100) look like this: |
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.
Two lines with:
colon seems weird:
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.
removed one of them which should not have been there
plugins/hydra_nevergrad_sweeper/hydra_plugins/hydra_nevergrad_sweeper/__init__.py
Outdated
Show resolved
Hide resolved
``` | ||
|
||
The application `main` returns a float which we want to minimimize, the minimum is 0 and reached for: | ||
The the function decorated with `@hydra.main()` returns a float which we want to minimize, the minimum is 0 and reached for: |
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.
Should mention how to maximize somewhere in the readme.
Maybe as a commented out line in the config node above.
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.
added to the conf
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.
I feel it's mostly done now.
There must be some corner cases but I expect that will be solved when we agree on the inputs
``` | ||
|
||
The application `main` returns a float which we want to minimimize, the minimum is 0 and reached for: | ||
The the function decorated with `@hydra.main()` returns a float which we want to minimize, the minimum is 0 and reached for: |
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.
added to the conf
Landing it (without even taking final final look). Thanks for all your work on this @jrapin. |
Motivation
This is a proof of concept for a Nevergrad sweeper pluging.
I won't have time to work much on it so if anyone is willing to take it from there, feel free :D
The current concerns I have:
0:10
in the commandline would get integers only and may not realize it, maybe the default should be float, and we'd need another way to cast to integers.Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Unit tests are included, as well as a runnable example
Related Issues and PRs
Closes #330