def _get_model(self, batch_shape, num_outputs, **tkwargs):
     train_x, train_y = _get_random_data(batch_shape=batch_shape,
                                         num_outputs=num_outputs,
                                         **tkwargs)
     train_yvar = (0.1 + 0.1 * torch.rand_like(train_y))**2
     model = HeteroskedasticSingleTaskGP(train_X=train_x,
                                         train_Y=train_y,
                                         train_Yvar=train_yvar)
     mll = ExactMarginalLogLikelihood(model.likelihood, model).to(**tkwargs)
     fit_gpytorch_model(mll, options={"maxiter": 1})
     return model
Exemple #2
0
 def _get_model_and_data(self, batch_shape, num_outputs, **tkwargs):
     train_X, train_Y = _get_random_data(batch_shape=batch_shape,
                                         num_outputs=num_outputs,
                                         **tkwargs)
     train_Yvar = (0.1 + 0.1 * torch.rand_like(train_Y))**2
     model_kwargs = {
         "train_X": train_X,
         "train_Y": train_Y,
         "train_Yvar": train_Yvar,
     }
     model = HeteroskedasticSingleTaskGP(**model_kwargs)
     return model, model_kwargs
 def _get_model_and_data(
     self, batch_shape, m, outcome_transform=None, input_transform=None, **tkwargs
 ):
     with manual_seed(0):
         train_X, train_Y = _get_random_data(batch_shape=batch_shape, m=m, **tkwargs)
         train_Yvar = (0.1 + 0.1 * torch.rand_like(train_Y)) ** 2
     model_kwargs = {
         "train_X": train_X,
         "train_Y": train_Y,
         "train_Yvar": train_Yvar,
         "input_transform": input_transform,
         "outcome_transform": outcome_transform,
     }
     model = HeteroskedasticSingleTaskGP(**model_kwargs)
     return model, model_kwargs
 def _get_model_and_data(self,
                         batch_shape,
                         m,
                         outcome_transform=None,
                         **tkwargs):
     with manual_seed(0):
         train_X, train_Y = _get_random_data(batch_shape=batch_shape,
                                             num_outputs=m,
                                             **tkwargs)
     train_Yvar = (0.1 + 0.1 * torch.rand_like(train_Y))**2
     model_kwargs = {
         "train_X": train_X,
         "train_Y": train_Y,
         "train_Yvar": train_Yvar,
     }
     if outcome_transform is not None:
         model_kwargs["outcome_transform"] = outcome_transform
     model = HeteroskedasticSingleTaskGP(**model_kwargs)
     return model, model_kwargs