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_destinationbatch_shapeThe batch shape of the model.
call_super_initdump_patchesnum_outputsThe number of outputs of the model.
train_targetslikelihoodtrainingMethods
Define the computation performed at every call.
- Parameters:
- 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
Moduleinstance 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: