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

Remove transform=None from GPyTorch constraints #2544

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions botorch/models/contextual_multioutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,7 @@ def __init__(
)
self.task_covar_module_base = RBFKernel(
ard_num_dims=n_embs,
lengthscale_constraint=Interval(
0.0, 2.0, transform=None, initial_value=1.0
),
lengthscale_constraint=Interval(0.0, 2.0, initial_value=1.0),
)
self.to(train_X)

Expand Down
4 changes: 1 addition & 3 deletions botorch/models/gp_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,7 @@ def __init__(
noise_likelihood = GaussianLikelihood(
noise_prior=SmoothedBoxPrior(-3, 5, 0.5, transform=torch.log),
batch_shape=self._aug_batch_shape,
noise_constraint=GreaterThan(
MIN_INFERRED_NOISE_LEVEL, transform=None, initial_value=1.0
),
noise_constraint=GreaterThan(MIN_INFERRED_NOISE_LEVEL, initial_value=1.0),
)
# Likelihood will always get evaluated with transformed X, so we need to
# transform the training data before constructing the noise model.
Expand Down
1 change: 0 additions & 1 deletion botorch/models/multitask.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ def __init__(
noise_prior=noise_prior,
noise_constraint=GreaterThan(
MIN_INFERRED_NOISE_LEVEL,
transform=None,
initial_value=noise_prior.mode,
),
rank=kwargs.get("likelihood_rank", 0),
Expand Down
2 changes: 1 addition & 1 deletion botorch/models/pairwise_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ def __init__(
ard_num_dims=self.dim,
lengthscale_prior=ls_prior,
lengthscale_constraint=GreaterThan(
lower_bound=1e-4, transform=None, initial_value=ls_prior_mode
lower_bound=1e-4, initial_value=ls_prior_mode
),
dtype=torch.float64,
),
Expand Down
1 change: 0 additions & 1 deletion botorch/models/transforms/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,6 @@ def __init__(
p_name = f"concentration{i}"
constraint = GreaterThan(
self._min_concentration_level,
transform=None,
# set the initial value to be the identity transformation
initial_value=1.0,
)
Expand Down
4 changes: 1 addition & 3 deletions botorch/models/utils/gpytorch_modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def get_gaussian_likelihood_with_gamma_prior(
batch_shape=batch_shape,
noise_constraint=GreaterThan(
MIN_INFERRED_NOISE_LEVEL,
transform=None,
initial_value=noise_prior_mode,
),
)
Expand All @@ -91,7 +90,6 @@ def get_gaussian_likelihood_with_lognormal_prior(
batch_shape=batch_shape,
noise_constraint=GreaterThan(
MIN_INFERRED_NOISE_LEVEL,
transform=None,
initial_value=noise_prior.mode,
),
)
Expand Down Expand Up @@ -125,7 +123,7 @@ def get_covar_module_with_dim_scaled_prior(
batch_shape=batch_shape,
lengthscale_prior=lengthscale_prior,
lengthscale_constraint=GreaterThan(
2.5e-2, transform=None, initial_value=lengthscale_prior.mode
2.5e-2, initial_value=lengthscale_prior.mode
),
# pyre-ignore[6] GPyTorch type is unnecessarily restrictive.
active_dims=active_dims,
Expand Down
Loading