-
Notifications
You must be signed in to change notification settings - Fork 128
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
Cost bo loop #195
Merged
Merged
Cost bo loop #195
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
21bae8c
add missing docstring
aaronkl 11beb8c
allow to pass cost of initial design
aaronkl 1fae4e2
more expressive naming
aaronkl 663fdbe
add simple unit test
aaronkl 34775ff
Merge branch 'master' into cost_bo_loop
aaronkl 3b8191a
Merge branch 'master' into cost_bo_loop
apaleyes d9c016c
Merge branch 'master' into cost_bo_loop
apaleyes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
22 changes: 22 additions & 0 deletions
22
integration_tests/emukit/bayesian_optimization/test_create_bayesian_optimization_loop.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import numpy as np | ||
|
||
from emukit.test_functions.forrester import forrester_function | ||
from emukit.examples.gp_bayesian_optimization.optimization_loops import create_bayesian_optimization_loop | ||
from emukit.examples.gp_bayesian_optimization.enums import AcquisitionType, ModelType | ||
|
||
|
||
def test_loop_state(): | ||
|
||
fcn, cs = forrester_function() | ||
n_init = 5 | ||
|
||
x_init = np.random.rand(n_init, 1) | ||
y_init = np.random.rand(n_init, 1) | ||
c_init = np.random.rand(n_init, 1) | ||
bo = create_bayesian_optimization_loop(x_init=x_init, y_init=y_init, | ||
parameter_space=cs, acquisition_type=AcquisitionType.EI, | ||
model_type=ModelType.RandomForest, cost_init=c_init) | ||
|
||
assert bo.loop_state.X.shape[0] == n_init | ||
assert bo.loop_state.Y.shape[0] == n_init | ||
assert bo.loop_state.cost.shape[0] == n_init |
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.
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.
Good catch!