-
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
Change recommend to raise an error in MOO case #1213
Conversation
…research/nevergrad into theoajc/update_cb_tests
…into update_recoms
nevergrad/optimization/base.py
Outdated
@@ -518,6 +518,8 @@ def recommend(self) -> p.Parameter: | |||
The candidate with minimal loss. :code:`p.Parameters` have field :code:`args` and :code:`kwargs` which can be directly used | |||
on the function (:code:`objective_function(*candidate.args, **candidate.kwargs)`). | |||
""" | |||
if self.num_objectives > 1: | |||
raise RuntimeError("No best candidate in MOO.") |
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.
might be helpful to tell the user to use the pareto_front function instead, so that they dont get lost
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.
"No best candidate in MOO. Use pareto_front function instead to get the set of all non-dominated candidates."
How is that?
Co-authored-by: Jérémy Rapin <jrapin.github@gmail.com>
Types of changes
Motivation and Context / Related issue
Make recommend raise an error when doing MOO because during MOO there is no best candidate to recommend so not appropriate.
How Has This Been Tested (if it applies)
Ensure all tests that this change broke passed by making small changes elsewhere when necessary (i.e. to minimize).
Checklist