stk_search.Search_algorithm.Botorch_kernels.SingleTaskGP

class stk_search.Search_algorithm.Botorch_kernels.SingleTaskGP(train_X, train_Y, likelihood=None, covar_module=None, mean_module=None, outcome_transform=None, input_transform=None)[source]

A single-task exact GP model.

A single-task exact GP using relatively strong priors on the Kernel hyperparameters, which work best when covariates are normalized to the unit cube and outcomes are standardized (zero mean, unit variance).

This model works in batch mode (each batch having its own hyperparameters). When the training observations include multiple outputs, this model will use batching to model outputs independently.

Use this model when you have independent output(s) and all outputs use the same training data. If outputs are independent and outputs have different training data, use the ModelListGP. When modeling correlations between outputs, use the MultiTaskGP.

Example

>>> train_X = torch.rand(20, 2)
>>> train_Y = torch.sin(train_X).sum(dim=1, keepdim=True)
>>> model = SingleTaskGP(train_X, train_Y)

Attributes

T_destination

batch_shape

The batch shape of the model.

call_super_init

dump_patches

num_outputs

The number of outputs of the model.

train_targets

likelihood

training

Methods

forward

Define the computation performed at every call.

Parameters:
  • train_X (Tensor) –

  • train_Y (Tensor) –

  • likelihood (Optional[Likelihood]) –

  • covar_module (Optional[Module]) –

  • mean_module (Optional[Mean]) –

  • outcome_transform (Optional[OutcomeTransform]) –

  • input_transform (Optional[InputTransform]) –

forward(x)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

Parameters:

x (Tensor) –

Return type:

MultivariateNormal