Skip to content

Commit

Permalink
Add De Morgan's to rules expression + comments
Browse files Browse the repository at this point in the history
  • Loading branch information
khurram-ghani committed Jan 12, 2024
1 parent 683c38d commit 0f75f1d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/unit/acquisition/test_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1816,7 +1816,7 @@ def test_multi_trust_region_box_acquire_filters() -> None:

# Create a BatchTrustRegionBox instance with the mock base_rule.
subspaces = [SingleObjectiveTrustRegionBox(search_space) for _ in range(2)]
rule = BatchTrustRegionBox(subspaces, mock_base_rule) # type: ignore[var-annotated]
rule: BatchTrustRegionBox[ProbabilisticModel] = BatchTrustRegionBox(subspaces, mock_base_rule)

rule.acquire(search_space, models, datasets)(None)

Expand Down
8 changes: 4 additions & 4 deletions trieste/acquisition/rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -1234,8 +1234,8 @@ def acquire(
# Otherwise, run the base rule as is (i.e as a batch), once with all models and datasets.
# Note: this should only trigger on the first call to `acquire`, as after that we will
# have a list of rules in `self._rules`.
if self._rules is None and (
_num_local_models > 0 or not isinstance(self._rule, EfficientGlobalOptimization)
if self._rules is None and not (
_num_local_models == 0 and isinstance(self._rule, EfficientGlobalOptimization)
):
self._rules = [copy.deepcopy(self._rule) for _ in range(num_subspaces)]

Expand Down Expand Up @@ -1282,8 +1282,8 @@ def state_func(
_points.append(rule.acquire(subspace, _models, _datasets))
points = tf.stack(_points, axis=1)
else:
# Filter out local datasets as this is the EGO rule with normal acquisition
# functions that don't expect local datasets.
# Filter out local datasets as this is a rule (currently only EGO) with normal
# acquisition functions that don't expect local datasets.
# Note: no need to filter out local models, as setups with local models
# are handled above (i.e. we run the base rule sequentially for each subspace).
if datasets is not None:
Expand Down

0 comments on commit 0f75f1d

Please sign in to comment.