Skip to content

Commit

Permalink
Robust Gaussian Processes via Relevance Pursuit (pytorch#2608)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: pytorch#2608

This commit adds the implementation of the [Robust Gaussian Processes via Relevance Pursuit](https://arxiv.org/pdf/2410.24222) models and algorithms of the NeurIPS 2024 article.

Differential Revision: D65343571
  • Loading branch information
SebastianAment authored and facebook-github-bot committed Nov 5, 2024
1 parent 3ca48d0 commit 9f3622c
Show file tree
Hide file tree
Showing 11 changed files with 2,082 additions and 8 deletions.
13 changes: 9 additions & 4 deletions botorch/models/gpytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,21 +387,23 @@ def _apply_noise(
obs_noise = observation_noise.squeeze(-1)
mvn = self.likelihood(
mvn,
X,
[X],
noise=obs_noise.expand(noise_shape),
)
elif isinstance(self.likelihood, FixedNoiseGaussianLikelihood):
# Use the mean of the previous noise values (TODO: be smarter here).
observation_noise = self.likelihood.noise.mean(dim=-1, keepdim=True)
mvn = self.likelihood(
mvn,
X,
[X],
noise=observation_noise.expand(noise_shape),
)
else:
mvn = self.likelihood(mvn, X)
mvn = self.likelihood(mvn, [X])
return mvn

# pyre-ignore[14]: Inconsistent override. Could not find parameter
# `Keywords(typing.Any)` in overriding signature.
def posterior(
self,
X: Tensor,
Expand Down Expand Up @@ -470,6 +472,7 @@ def posterior(
return posterior_transform(posterior)
return posterior

# pyre-ignore[14]: Inconsistent override. Could not find parameter `noise`.
def condition_on_observations(
self, X: Tensor, Y: Tensor, **kwargs: Any
) -> BatchedMultiOutputGPyTorchModel:
Expand Down Expand Up @@ -632,7 +635,7 @@ def batch_shape(self) -> torch.Size:
raise NotImplementedError(msg + " that are not broadcastble.")
return next(iter(batch_shapes))

# pyre-fixme[15]: Inconsistent override in return types
# pyre-fixme[14]: Inconsistent override in return types
def posterior(
self,
X: Tensor,
Expand Down Expand Up @@ -838,6 +841,8 @@ def _apply_noise(
)
return self.likelihood(mvn, X)

# pyre-ignore[14]: Inconsistent override. Could not find parameter
# `Keywords(typing.Any)` in overriding signature.
def posterior(
self,
X: Tensor,
Expand Down
453 changes: 453 additions & 0 deletions botorch/models/likelihoods/sparse_outlier_noise.py

Large diffs are not rendered by default.

Loading

0 comments on commit 9f3622c

Please sign in to comment.