Skip to content

Commit 92bc3de

Browse files
committed
formatting, build
1 parent d0314bc commit 92bc3de

File tree

9 files changed

+21648
-1655
lines changed

9 files changed

+21648
-1655
lines changed

botorch/sampling/pathwise/features/maps.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def forward(self, x: Tensor, **kwargs: Any) -> Tensor:
128128

129129
blocks: list[Tensor] = []
130130

131-
shape = self.raw_output_shape # target output shape
132-
ndim = len(shape) # #feature dimensions incl. batch
131+
shape = self.raw_output_shape # target output shape
132+
ndim = len(shape) # #feature dimensions incl. batch
133133

134134
for feature_map in self:
135135
# 1. Evaluate (dense) features for the current sub-map.
@@ -152,7 +152,7 @@ def forward(self, x: Tensor, **kwargs: Any) -> Tensor:
152152
# only up to such a scaling).
153153
num_copies = prod(tile_shape)
154154
if num_copies > 1:
155-
block = block * (num_copies ** -0.5)
155+
block = block * (num_copies**-0.5)
156156

157157
# ``multi_index`` inserts ``None`` (i.e. `None` in slice syntax)
158158
# so that broadcasting expands the tensor along the new axes
@@ -174,8 +174,8 @@ def forward(self, x: Tensor, **kwargs: Any) -> Tensor:
174174

175175
@property
176176
def raw_output_shape(self) -> Size:
177-
# If the container is empty (e.g. DirectSumFeatureMap([])), treat the
178-
# output as 0-D until feature maps are added.
177+
# If the container is empty (e.g. DirectSumFeatureMap([])), treat the
178+
# output as 0-D until feature maps are added.
179179
if not self:
180180
return Size([])
181181

botorch/sampling/pathwise/prior_samplers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from __future__ import annotations
88

9-
from copy import deepcopy
109
from typing import Any, Callable, List
1110

1211
import torch

botorch/sampling/pathwise/update_strategies.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from __future__ import annotations
88

99
from collections.abc import Callable
10-
from copy import deepcopy
1110
from types import NoneType
1211
from typing import Any
1312

@@ -167,7 +166,9 @@ def _draw_kernel_feature_paths_MultiTaskGP(
167166
# Determine total input dimensionality and identify the task-feature index.
168167
num_inputs = points.shape[-1]
169168
task_index = (
170-
num_inputs + model._task_feature if model._task_feature < 0 else model._task_feature
169+
num_inputs + model._task_feature
170+
if model._task_feature < 0
171+
else model._task_feature
171172
)
172173

173174
# MTGP should always provide a ProductKernel = data × task. Enforce that
@@ -177,9 +178,11 @@ def _draw_kernel_feature_paths_MultiTaskGP(
177178

178179
if not isinstance(model.covar_module, ProductKernel):
179180
raise RuntimeError(
180-
"MultiTaskGP `covar_module` is expected to be a ProductKernel (data × task) "
181+
"MultiTaskGP `covar_module` is expected to be a ProductKernel "
182+
"(data × task) "
181183
f"but found {type(model.covar_module).__name__}. If you build a custom "
182-
"MTGP variant please wrap the two kernels with gpytorch.kernels.ProductKernel."
184+
"MTGP variant please wrap the two kernels with "
185+
"gpytorch.kernels.ProductKernel."
183186
)
184187

185188
combined_kernel = model.covar_module

test/sampling/pathwise/test_prior_samplers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def test_multitask_gp_kernel_handling(self):
235235
model2.covar_module = simple_kernel # Non-ProductKernel
236236

237237
import pytest
238+
238239
with pytest.raises(RuntimeError):
239240
draw_kernel_feature_paths(model2, sample_shape=Size([1]))
240241

test/sampling/pathwise/test_update_strategies.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ def test_multitask_gp_kernel_handling(self):
312312
model2.covar_module = simple_kernel # Non-ProductKernel
313313

314314
import pytest
315+
315316
with pytest.raises(RuntimeError):
316317
gaussian_update(model=model2, sample_values=sample_values)
317318

website/notebooks_community.json

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1 @@
1-
[
2-
{
3-
"id": "clf_constrained_bo",
4-
"title": "BO with Binary Black-box Constraint"
5-
},
6-
{
7-
"id": "hentropy_search",
8-
"title": "H-Entropy Search"
9-
},
10-
{
11-
"id": "multi_source_bo",
12-
"title": "Multi-Information Source BO with Augmented GP"
13-
},
14-
{
15-
"id": "vbll_thompson_sampling",
16-
"title": "Variational Bayesian Last Layers for BO"
17-
}
18-
]
1+
[]

0 commit comments

Comments
 (0)