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

Add ScaleKernel to get_covar_module_with_dim_scaled_prior #2619

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
10 changes: 7 additions & 3 deletions botorch/models/utils/gpytorch_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def get_covar_module_with_dim_scaled_prior(
batch_shape: torch.Size | None = None,
use_rbf_kernel: bool = True,
active_dims: Sequence[int] | None = None,
) -> MaternKernel | RBFKernel:
"""Returns an RBF or Matern kernel with priors
) -> ScaleKernel:
"""Returns an ScaleKernel based on RBF or Matern kernel with priors
from [Hvarfner2024vanilla]_.

Args:
Expand All @@ -130,4 +130,8 @@ def get_covar_module_with_dim_scaled_prior(
# pyre-ignore[6] GPyTorch type is unnecessarily restrictive.
active_dims=active_dims,
)
return base_kernel
return ScaleKernel(
base_kernel=base_kernel,
batch_shape=batch_shape,
outputscale_prior=GammaPrior(2.0, 0.15),
)
Loading