-
Notifications
You must be signed in to change notification settings - Fork 15
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
Implement AxModelManager
and allow building GP models from diagnostics
#178
Merged
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
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…s into feature/ax_model_manager
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…s into feature/ax_model_manager
…s into feature/ax_model_manager
AngelFP
changed the title
Implement the AxModelManager class
[WIP] Implement the AxModelManager class
Feb 15, 2024
…s into feature/ax_model_manager
for more information, see https://pre-commit.ci
…s into feature/ax_model_manager
- Formatting. - Rename `plot_model` to `plot_contour`. - Make `_get_best_point` and `_get_mid_point` internal methods. - Rename arguments of `plot_contour` for consistency. - Check if Ax is installed (it should remain an optional dependency of optimas). - Improve docstrings. - Rename `fixed_point` to `fixed_parameters`, since it is not really a point (it would be slice actually). - Replace `RuntimeError` with more appropriate `ValueError`. - Return figure and axis in `plot_contour`. - Add `plot_slice` method.
for more information, see https://pre-commit.ci
…s into feature/ax_model_manager
for more information, see https://pre-commit.ci
AngelFP
changed the title
[WIP] Implement the AxModelManager class
Implement Mar 7, 2024
AxModelManager
class and allow building GP models from diagnostics
AngelFP
changed the title
Implement
Implement Mar 7, 2024
AxModelManager
class and allow building GP models from diagnosticsAxModelManager
and allow building GP models from diagnostics
AngelFP
approved these changes
Mar 7, 2024
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.
Great @delaossa, thanks a lot for this!
I really like this feature, and the the PR looks great now.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This class provides easy access to build and evaluate surrogate models using
Ax
.If an
AxModelManager
instance is created from anExplorationDiagnostics
object using thebuild_gp_model
method, it will take automatically the varying parameters inExplorationDiagnostics
as the model parameters.This an example for one of the tests in
Optimas
:There are two objectives:
and two varying parameters:
Build (Gaussian Process) model for
f
from Optimas diagnostics data:Evaluate the model over the 10 best scoring
f
evaluations in the exploration diagnostics:Note that the best scoring evaluation in data (index=98) does not coincide with the best scoring according to the model (index=54).
Plot the model for
f
(mean and standard error),mark with crosses the top 10 evaluations and add their trial indices:
One can also build a model for other objectives or analyzed parameters, e.g.:
Or a model with multiple metrics. This example use all the objectives present in the Optimas diagnostics:
Evaluate the model for
f2
over the 10 best scoringf2
evaluations in the exploration diagnostics:Plot the mean of the two models (
f
andf2
):The two models for
f
andf2
are very similar.The reason is that the real underlying function for
f
andf2
used in the tests is:So
f2
is just 2 *f
.However, since in the example we told optimas to find the minimum of
f
and the maximumf2
, the best evaluations fall in opposite regions.Let's plot the model of 'f' together with the real function:
We can see that, while the oscillations in
x1
are well captured by the model, this is not the case forx0
where the model just reproduces the "averaged" trend. This is surely due to the less dense sampling in thex0
dimension.Draws a slice of the model along
x1
withx0
fixed to its middle point.