-
Notifications
You must be signed in to change notification settings - Fork 358
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
Conversation
nevergrad/optimization/base.py
Outdated
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)) |
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.
@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), |
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.
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), |
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.
notice that it deteriorates the results, because it runs only 5 trials now instead of around 50 at the beginning
self._constraints_manager.max_trials // 2 | ||
if self.budget is None | ||
else (self.budget - self.num_ask), |
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.
this really had unexpected behaviors since it completely ignores max_trials
* 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>
Types of changes
Motivation and Context / Related issue
How Has This Been Tested (if it applies)
Checklist