2727from botorch .models .utils import gpt_posterior_settings
2828from botorch .models .utils .assorted import fantasize as fantasize_flag
2929from botorch .models .utils .gpytorch_modules import (
30- get_gaussian_likelihood_with_gamma_prior ,
30+ get_covar_module_with_dim_scaled_prior ,
31+ get_gaussian_likelihood_with_lognormal_prior ,
3132)
3233from botorch .posteriors import (
3334 GPyTorchPosterior ,
3435 HigherOrderGPPosterior ,
3536 TransformedPosterior ,
3637)
38+ from botorch .utils .types import _DefaultType , DEFAULT
3739from gpytorch .distributions import MultivariateNormal
38- from gpytorch .kernels import Kernel , MaternKernel
40+ from gpytorch .kernels import Kernel
3941from gpytorch .likelihoods import Likelihood
4042from gpytorch .models import ExactGP
41- from gpytorch .priors .torch_priors import GammaPrior , MultivariateNormalPrior
43+ from gpytorch .priors .torch_priors import MultivariateNormalPrior
4244from gpytorch .settings import fast_pred_var , skip_posterior_variances
4345from linear_operator .operators import (
4446 BatchRepeatLinearOperator ,
@@ -183,7 +185,7 @@ def __init__(
183185 num_latent_dims : Optional [list [int ]] = None ,
184186 learn_latent_pars : bool = True ,
185187 latent_init : str = "default" ,
186- outcome_transform : Optional [OutcomeTransform ] = None ,
188+ outcome_transform : Union [OutcomeTransform , _DefaultType , None ] = DEFAULT ,
187189 input_transform : Optional [InputTransform ] = None ,
188190 ):
189191 r"""
@@ -196,7 +198,6 @@ def __init__(
196198 learn_latent_pars: If true, learn the latent parameters.
197199 latent_init: [default or gp] how to initialize the latent parameters.
198200 """
199-
200201 if input_transform is not None :
201202 input_transform .to (train_X )
202203
@@ -207,7 +208,11 @@ def __init__(
207208 raise NotImplementedError (
208209 "HigherOrderGP currently only supports 1-dim `batch_shape`."
209210 )
210-
211+ if outcome_transform == DEFAULT :
212+ outcome_transform = FlattenedStandardize (
213+ output_shape = train_Y .shape [- num_output_dims :],
214+ batch_shape = batch_shape ,
215+ )
211216 if outcome_transform is not None :
212217 if isinstance (outcome_transform , Standardize ) and not isinstance (
213218 outcome_transform , FlattenedStandardize
@@ -218,6 +223,7 @@ def __init__(
218223 f"{ train_Y .shape [- num_output_dims :]} and batch_shape="
219224 f"{ batch_shape } instead." ,
220225 RuntimeWarning ,
226+ stacklevel = 2 ,
221227 )
222228 outcome_transform = FlattenedStandardize (
223229 output_shape = train_Y .shape [- num_output_dims :],
@@ -232,7 +238,7 @@ def __init__(
232238 self ._input_batch_shape = batch_shape
233239
234240 if likelihood is None :
235- likelihood = get_gaussian_likelihood_with_gamma_prior (
241+ likelihood = get_gaussian_likelihood_with_lognormal_prior (
236242 batch_shape = self ._aug_batch_shape
237243 )
238244 else :
@@ -249,11 +255,9 @@ def __init__(
249255 else :
250256 self .covar_modules = ModuleList (
251257 [
252- MaternKernel (
253- nu = 2.5 ,
254- lengthscale_prior = GammaPrior (3.0 , 6.0 ),
255- batch_shape = self ._aug_batch_shape ,
258+ get_covar_module_with_dim_scaled_prior (
256259 ard_num_dims = 1 if dim > 0 else train_X .shape [- 1 ],
260+ batch_shape = self ._aug_batch_shape ,
257261 )
258262 for dim in range (self ._num_dimensions )
259263 ]
0 commit comments