-
Notifications
You must be signed in to change notification settings - Fork 310
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
Get rid of surrogate problem subclasses #2607
Open
esantorella
wants to merge
6
commits into
facebook:main
Choose a base branch
from
esantorella:export-D60285442
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…k#2603) Summary: Pull Request resolved: facebook#2603 Context: Surrogate benchmark problems allow for downloading datasets and constructing a surrogate lazily. Since the surrogates and datasets are only needed for the `Runner`, it makes sense to confine this logic to `SurrogateRunner`. This gives surrogate benchmark problems an interface that is much clsoer to that of non-surrogate benchmark problems. In the future, we should be able to get down to just one `BenchmarkProblem` class. This PR: * Moves lazy construction of surrogates from the `Problem` to the `Runner`. * Moves corresponding unit tests from the problem's file to the runner's. Differential Revision: D60266288
…eritance (facebook#2601) Summary: Pull Request resolved: facebook#2601 Context: * Problems that lack an `optimal_value` get a NaN score and cannot really be used for benchmarking except when aggregated. This is a nasty "gotcha." We don't always know the optimum, but IMO it is better to guess. * The inheritance structure of benchmark problems is too complex and will make subsequent refactors harder. This PR: * Adds an `optimal_value` requirement to `BenchmarkProblem` and makes `BenchmarkProblem` the base class to `SurrogateBenchmarkProblem`, enabling `BenchmarkProblem` to be the only type annotation needed. Therefore, the type annotation `BenchmarkProblemProtocol` is no longer necessary. It will be removed in the next PR. * No longer allows for giving an NaN score to benchmarks where the problem lacks an optimal value, because this won't happen. * Updates a lot of annotations. * Raises an exception for constrained multi-objective problems. * Use dataclasses to cut down on code. Differential Revision: D60145193 Reviewed By: saitcakmak
…e annotations (facebook#2602) Summary: Pull Request resolved: facebook#2602 These are no longer necessary. See previous PR for context. This change reaps them and updates type annotations. Differential Revision: D60146081 Reviewed By: saitcakmak
Summary: Context: Benchmark problems are sometimes created with class methods `SingleObjectiveBenchmarkProblem.from_botorch`, `SingleObjectiveBenchmarkProblem.from_botorch_synthetic`, and `MultiObjectiveBenchmarkProblem.from_botorch_multi_objective`, the former two now being identical. This creates the need for some tricky type annotations; to me, replacing these with functions is obviously cleaner. This will make it easier to consolidate classes in the future. This PR: * Replaces `SingleObjectiveBenchmarkProblem.from_botorch` and `SingleObjectiveBenchmarkProblem.from_botorch_synthetic` with `create_single_objective_problem_from_botorch` * Replaces `MultiObjectiveBenchmarkProblem.from_botorch_multi_objective` with `create_multi_objective_problem_from_botorch` Differential Revision: D60284484
Summary: The class is not adding anything. We should check if problems are single-objective by looking at the type of their `optimization_config`. This PR: * Removes `SingleObjectiveBenchmarkProblem` * Replaces all references to it with `BenchmarkProblem` * Removes `get_benchmark_problem`, which is redundant with `get_single_objective_benchmark_problem` Differential Revision: D60285191
Summary: These are no longer doing anything distinctive. The proper way to check if a problem is using a surrogate is to check the type of its runner. Differential Revision: D60285442
facebook-github-bot
added
the
CLA Signed
Do not delete this pull request or issue due to inactivity.
label
Jul 26, 2024
This pull request was exported from Phabricator. Differential Revision: D60285442 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary: These are no longer doing anything distinctive. The proper way to check if a problem is using a surrogate is to check the type of its runner.
Differential Revision: D60285442