Skip to content
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

Batch trust regions implementation of TURBO #791

Merged
merged 71 commits into from
Dec 18, 2023
Merged
Changes from 3 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
c89583e
Add support for local models and datasets (WIP)
khurram-ghani Sep 21, 2023
c8aebec
Add unit test for local models (WIP)
khurram-ghani Sep 25, 2023
b361e6d
Merge remote-tracking branch 'origin/develop' into khurram/batch_turbo
khurram-ghani Sep 27, 2023
4b3c2de
Update multi model/dataset test (WIP)
khurram-ghani Sep 29, 2023
28803aa
Add unit test for keep datasets in regions
khurram-ghani Oct 3, 2023
e99df96
Add more tests and move to local tags class
khurram-ghani Oct 6, 2023
2de6271
Always include global dataset in mapping
khurram-ghani Oct 6, 2023
6236c95
Add filter_mask method to trust region
khurram-ghani Oct 6, 2023
e96ebe8
Add more testing
khurram-ghani Oct 9, 2023
9a7dd23
Fix mypy model type issues
khurram-ghani Oct 10, 2023
4622a98
Add ask_tell testing
khurram-ghani Oct 10, 2023
af44e48
Fix summary init when only global dataset
khurram-ghani Oct 10, 2023
ef9e455
Remove walrus operator
khurram-ghani Oct 11, 2023
59e0cab
Update test, ask_tell data not changed in-place
khurram-ghani Oct 11, 2023
e4a5342
Add some test comments
khurram-ghani Oct 11, 2023
69a8590
Add some rule comments
khurram-ghani Oct 11, 2023
40df585
Allow input-multi-observers for batch observer
khurram-ghani Oct 11, 2023
ee1ee56
Allow multiple models/datasets for base rule
khurram-ghani Oct 11, 2023
7d03a04
Support multiple models/datasets in region selects
khurram-ghani Oct 12, 2023
8551d72
Fix TR plotting history colors
khurram-ghani Oct 12, 2023
b571733
Add notebook init points explanation
khurram-ghani Oct 12, 2023
2a934d1
Rename region index and add init param
khurram-ghani Oct 16, 2023
bea54ea
Merge branch 'develop' into khurram/local_models
khurram-ghani Oct 16, 2023
c8fb1d1
WIP
khurram-ghani Oct 13, 2023
c48e6d5
Add more TURBO implementation + attempt type fixes
khurram-ghani Oct 17, 2023
52f7975
Remove old comment
khurram-ghani Oct 17, 2023
b2eb662
Tidy-up redundant expression
khurram-ghani Oct 17, 2023
69e86cf
Fix TURBOBox and temp changes in TURBO for match
khurram-ghani Oct 17, 2023
08bccf6
Merge remote-tracking branch 'origin/khurram/local_models' into khurr…
khurram-ghani Oct 17, 2023
4a36cf9
Add intermediate box region class
khurram-ghani Oct 17, 2023
523aaab
Keep full datasets along with filtered ones
khurram-ghani Oct 18, 2023
8716143
Merge remote-tracking branch 'origin/khurram/local_models' into khurr…
khurram-ghani Oct 18, 2023
5f66432
Move subspace update to a new rule method
khurram-ghani Oct 19, 2023
7b7bf33
Add temp notebook for TURBO comparisons
khurram-ghani Oct 19, 2023
3789af2
Save TR subspaces in acquire to re-use later
khurram-ghani Oct 19, 2023
661c3a2
Update notebook to use TURBOBOx
khurram-ghani Oct 19, 2023
5b3ec0f
Make changes from PR feedback
khurram-ghani Nov 16, 2023
cb3ca46
Merge branch 'khurram/local_models' into khurram/batch_turbo
khurram-ghani Nov 16, 2023
6767f10
Fix rename after merge
khurram-ghani Nov 16, 2023
ce90838
Fix compare notebook after merge
khurram-ghani Nov 17, 2023
31b96d0
Move rule create later and tidy filtering dataset
khurram-ghani Nov 17, 2023
662947d
More testing in notebook
khurram-ghani Nov 17, 2023
8e26fba
Remove redundant dataset filtering
khurram-ghani Nov 17, 2023
2c21f85
Merge remote-tracking branch 'origin/develop' into khurram/local_models
khurram-ghani Nov 22, 2023
e5cccc8
Address some of the recent feedback
khurram-ghani Nov 23, 2023
25da01b
Fix dataset mypy error
khurram-ghani Nov 23, 2023
292faaa
Copy dataset in optimizers to avoid changing it
khurram-ghani Nov 24, 2023
9170c64
Share DatasetChecker and tidy-up exp values in tests
khurram-ghani Nov 24, 2023
efd2fc0
Address more feedback
khurram-ghani Nov 24, 2023
cdd4cbc
Merge branch 'khurram/local_models' into khurram/batch_turbo
khurram-ghani Nov 27, 2023
8d497aa
Remove prev TURBO and update tests to use new class
khurram-ghani Nov 27, 2023
586f9a8
Remove notebook for testing
khurram-ghani Nov 27, 2023
d8442a8
Create dataset and update at start of optim
khurram-ghani Nov 29, 2023
ff84690
Merge remote-tracking branch 'origin/develop' into khurram/local_models
khurram-ghani Nov 29, 2023
505631a
Avoid default num_models in integ tests
khurram-ghani Nov 29, 2023
b90d3a1
Fix old python typing issue
khurram-ghani Nov 29, 2023
250c647
Merge branch 'khurram/local_models' into khurram/batch_turbo
khurram-ghani Nov 29, 2023
7aec057
Address feedback
khurram-ghani Nov 30, 2023
6a42f05
Address more comments
khurram-ghani Dec 5, 2023
4e5aad6
Only copy state with track_state==True
khurram-ghani Dec 5, 2023
c01432c
Add comment explaining copy
khurram-ghani Dec 5, 2023
13b313d
Deepcopy subspace internal to rule
khurram-ghani Dec 5, 2023
a8ed8ce
Keep global datasets unfiltered
khurram-ghani Dec 11, 2023
9ba931d
Add notebook intro and improve TREGO text
khurram-ghani Dec 13, 2023
1de7e20
Merge remote-tracking branch 'origin/develop' into khurram/local_models
khurram-ghani Dec 13, 2023
a75e618
Use flatten_... func and add comment
khurram-ghani Dec 13, 2023
50afc55
Merge remote-tracking branch 'origin/khurram/local_models' into khurr…
khurram-ghani Dec 13, 2023
99aa9b2
Improve TR explanations
khurram-ghani Dec 14, 2023
30fe281
Merge remote-tracking branch 'origin/develop' into khurram/batch_turbo
khurram-ghani Dec 14, 2023
4f51581
Fix merge issues
khurram-ghani Dec 14, 2023
82919f2
Clarify parallel acq comments
khurram-ghani Dec 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions trieste/objectives/utils.py
Original file line number Diff line number Diff line change
@@ -79,9 +79,6 @@ def mk_batch_observer(
"""

@check_shapes("qps: [n_points, batch_size, n_dims]")
# Note that the return type is not correct, but that is what mypy is happy with. It should be
# Mapping[Tag, Dataset] if key is not None, otherwise Dataset.
# One solution is to create two separate functions, but that will result in some duplicate code.
def _observer(qps: TensorType) -> Mapping[Tag, Dataset]:
# Call objective with rank 2 query points by flattening batch dimension.
# Some objectives might only expect rank 2 query points, so this is safer.
4 changes: 2 additions & 2 deletions trieste/utils/misc.py
Original file line number Diff line number Diff line change
@@ -266,8 +266,8 @@ class LocalTag:
local_index: Optional[int]

def __post_init__(self) -> None:
if self.is_local and (self.local_index is None or self.local_index < 0):
raise ValueError("local index must be non-negative")
if self.local_index is not None and self.local_index < 0:
raise ValueError(f"local index must be non-negative, got {self.local_index}")

@property
def is_local(self) -> bool: