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

[PR on PR] Fix constraints #1079

Merged
merged 4 commits into from
Mar 16, 2021
Merged

[PR on PR] Fix constraints #1079

merged 4 commits into from
Mar 16, 2021

Conversation

jrapin
Copy link
Contributor

@jrapin jrapin commented Mar 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

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 Mar 15, 2021
@jrapin jrapin changed the base branch from master to ctr_and_cstsolve March 15, 2021 18:59
Comment on lines 444 to 447
max_trials_ask = max_trials
if self.budget is not None: # dont use too much internal optimizer budget for this
# this update is probably pointless though, since the budget will be consumed and we may use too much budget anyway
max_trials_ask = max(1, min(max_trials, (self.budget - self.num_ask) // 2))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@teytaud actually I am not sure what this solves at all, for one shot optimizers it will just change nothing and fail anyway :s

@@ -523,7 +523,7 @@ def _ellips(x: np.ndarray) -> float:
"penalization,expected,as_layer",
[
(False, [1.005573e00, 3.965783e-04], False),
(True, [1.000001, 0.002842], False),
(True, [0.999924, -0.111009], False),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

notice that it deteriorates the results, because it runs only 5 trials now instead of around 50 at the beginning

@@ -523,7 +523,7 @@ def _ellips(x: np.ndarray) -> float:
"penalization,expected,as_layer",
[
(False, [1.005573e00, 3.965783e-04], False),
(True, [1.000001, 0.002842], False),
(True, [0.999924, -0.111009], False),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

notice that it deteriorates the results, because it runs only 5 trials now instead of around 50 at the beginning

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 Author

Choose a reason for hiding this comment

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

this really had unexpected behaviors since it completely ignores max_trials

@jrapin jrapin merged commit af0ef7c into ctr_and_cstsolve Mar 16, 2021
@jrapin jrapin deleted the fix_constraints branch March 16, 2021 18:29
teytaud added a commit that referenced this pull request Mar 17, 2021
* cst_solver

* warning

* warning

* fix

* black

* fix keras issue

* Update test_mlfunctionlib.py

* black

* [PR on cstsolve PR] Try to extract constraint solving (#968)

* returnpenalties

* fix

* removeprints

* extract

Co-authored-by: Jeremy Rapin <jrapin@fb.com>

* Update utils.py

* Fix a bug.

The previous code was ok only if the optimization method is not limited by the budget.

* Update base.py

* fix

* fix

* Update base.py

* Update base.py

* Update base.py

* fix

* fix

* fix

* fix_comment

* fixes

* black

* fix

* fix

* fix_typo

* Update nevergrad/optimization/base.py

Co-authored-by: Jérémy Rapin <jrapin.github@gmail.com>

* Update nevergrad/optimization/base.py

* Clarify suggest arguments (#1072)

* Skip rocket xp test for speed (#1075)

* Update parametrization flatten function (#1074)

* Add configuration for PSO + simplifications (#1073)

* Remove deprecated stuff (#1041)

* fix keras issue

* Update test_mlfunctionlib.py

* black

* remove_useless_stuff

* Update test_core.py

* fix

* Update core.py

* Morphing with Nevergrad (#1042)

* 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

* Add MOO xp variants (#1004)

* MOO variants

* Update experiments.py

* better_alignment

* better_doc

* fix

* minor

* fix

* CHANGELOG

* black

* fix

* [PR on PR] Fix constraints (#1079)

Co-authored-by: Jeremy Rapin <jrapin@fb.com>
Co-authored-by: Jérémy Rapin <jrapin.github@gmail.com>
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.

2 participants