|
17 | 17 | from botorch.models.transforms.input import InputTransform |
18 | 18 | from botorch.models.transforms.outcome import OutcomeTransform, Standardize |
19 | 19 | from botorch.models.utils import validate_input_scaling |
20 | | -from botorch.models.utils.gpytorch_modules import ( |
21 | | - get_covar_module_with_dim_scaled_prior, |
22 | | - get_gaussian_likelihood_with_lognormal_prior, |
23 | | -) |
24 | 20 | from botorch.utils.types import DEFAULT |
25 | | -from gpytorch.likelihoods.gaussian_likelihood import FixedNoiseGaussianLikelihood |
26 | | -from gpytorch.means.constant_mean import ConstantMean |
27 | 21 | from gpytorch.models.exact_gp import ExactGP |
28 | | -from gpytorch.module import Module |
29 | 22 | from torch import Tensor |
30 | 23 |
|
31 | 24 | from linear_operator.operators import CholLinearOperator, DiagLinearOperator |
@@ -136,7 +129,6 @@ def __init__( |
136 | 129 | batch_shape=self._aug_batch_shape, variables=variables |
137 | 130 | ) |
138 | 131 |
|
139 | | - |
140 | 132 | """ |
141 | 133 | ----------------------------------------------------------------------- |
142 | 134 | GP Kernel - Covariance |
@@ -562,23 +554,15 @@ def __init__(self, *gp_models): |
562 | 554 | def prepareToGenerateCommons(self): |
563 | 555 | self.models[0].input_transform.tf1.flag_to_store = True |
564 | 556 | # Make sure that this ModelListGP evaluation is fresh |
565 | | - if ( |
566 | | - "parameters_combined" |
567 | | - in self.models[0].input_transform.tf1.surrogate_parameters |
568 | | - ): |
569 | | - del self.models[0].input_transform.tf1.surrogate_parameters[ |
570 | | - "parameters_combined" |
571 | | - ] |
| 557 | + if ("surrogate_parameters" in self.models[0].input_transform.tf1.__dict__) and \ |
| 558 | + ("parameters_combined" in self.models[0].input_transform.tf1.surrogate_parameters): |
| 559 | + del self.models[0].input_transform.tf1.surrogate_parameters["parameters_combined"] |
572 | 560 |
|
573 | 561 | def cold_startCommons(self): |
574 | 562 | self.models[0].input_transform.tf1.flag_to_store = False |
575 | | - if ( |
576 | | - "parameters_combined" |
577 | | - in self.models[0].input_transform.tf1.surrogate_parameters |
578 | | - ): |
579 | | - del self.models[0].input_transform.tf1.surrogate_parameters[ |
580 | | - "parameters_combined" |
581 | | - ] |
| 563 | + if ("surrogate_parameters" in self.models[0].input_transform.tf1.__dict__) and \ |
| 564 | + ("parameters_combined" in self.models[0].input_transform.tf1.surrogate_parameters): |
| 565 | + del self.models[0].input_transform.tf1.surrogate_parameters["parameters_combined"] |
582 | 566 |
|
583 | 567 | def transform_inputs(self, X): |
584 | 568 | self.prepareToGenerateCommons() |
|
0 commit comments