Skip to content

Commit

Permalink
Remove transform=None from GPyTorch constraints
Browse files Browse the repository at this point in the history
Differential Revision: D62993873
  • Loading branch information
saitcakmak authored and facebook-github-bot committed Sep 18, 2024
1 parent 8536468 commit 9e27d0c
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 12 deletions.
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

0 comments on commit 9e27d0c

Please sign in to comment.