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

Dedicate half constraint budget to a suboptimizer #1047

Merged
merged 55 commits into from
Mar 17, 2021
Merged

Conversation

teytaud
Copy link
Contributor

@teytaud teytaud commented Feb 15, 2021

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Motivation and Context / Related issue

Camille posted a problem that was not solved by Nevergrad.
With the current PR the pb is solved.

How Has This Been Tested (if it applies)

Checklist

  • The documentation is up-to-date with the changes I made.
  • I have read the CONTRIBUTING document and completed the CLA (see CLA).
  • All tests passed, and additional code has been covered with new tests.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Feb 15, 2021
@teytaud teytaud changed the title Constraint solver that solve's Camille's pb [WIP] Constraint solver that solve's Camille's pb [DO NOT MERGE: might conflict with other work in progress] Feb 15, 2021
# the original candidate under the constraints.
penalty = cand._constraint_penalties()
if not penalty > 0: # constraints are satisfied
return cand
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't return this, since this candidate does not have any constraint anymore listed, it could create weird bugs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh my god thx.

teytaud and others added 3 commits March 12, 2021 17:53
Co-authored-by: Jérémy Rapin <jrapin.github@gmail.com>
jrapin and others added 11 commits March 15, 2021 09:37
* fix keras issue

* Update test_mlfunctionlib.py

* black

* remove_useless_stuff

* Update test_core.py

* fix

* Update core.py
* fix keras issue

* Update test_mlfunctionlib.py

* black

* WIP morphing

* fix

* Update core.py

* black

* fix

* fix

* syntax_fix

* fix

* fix

* fix

* fix

* fix

* black

* Update core.py

* Update core.py
* MOO variants

* Update experiments.py

* better_alignment

* better_doc

* fix
Comment on lines 438 to 440
self._constraints_manager.max_trials // 2
if self.budget is None
else (self.budget - self.num_ask),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why self.budget - self.num_ask? right now this does not make sense to me, and this seems unexpected

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the optimizer has a maximum budget, we want the budget we use to be smaller than the remaining budget before the optimizer crashes, hence self.budget - self.num_ask.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you probably want to do some kind of mean between self._constraints_manager.max_trials and self.budget - self.num_ask so that:
you don't go beyond max_trials, and you dont exhaust more than half the remaining budget of the optimizer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

min(self._constraints_manager.max_trials, self.budget - self.num_ask) could make sense.
Eventually all that stuff is going to be equipped with parameters for combining the auxiliary solver and the simple rejection of mutations.
Besides adding the famous constraint learning tool for expensive constraints that would be useful for some of our users... still a long way to go on the path to constraint management :-)

Copy link
Contributor

@jrapin jrapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, requesting changes again to make sure this is not merge before I understand the budget

@jrapin jrapin changed the title Constraint solver that solve's Camille's pb Dedicate half constraint budget to a suboptimizer Mar 17, 2021
@teytaud
Copy link
Contributor Author

teytaud commented Mar 17, 2021

Thx @jrapin , you deserve more credit than me for this PR.

@teytaud teytaud merged commit 7fadec0 into master Mar 17, 2021
@teytaud teytaud deleted the ctr_and_cstsolve branch March 17, 2021 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants