rapid_models.gp_models.templates¶
Module Contents¶
Classes¶
Model for standard GP regression |
- class rapid_models.gp_models.templates.ExactGPModel(train_x: torch.Tensor, train_y: torch.Tensor, mean_module: gpytorch.means.Mean, covar_module: gpytorch.kernels.Kernel, likelihood: gpytorch.likelihoods.Likelihood, path: str = '', name: str = '')¶
Bases:
gpytorch.models.ExactGPModel for standard GP regression
- forward(x: torch.Tensor) gpytorch.distributions.MultivariateNormal¶
- eval_mode()¶
Set model in evaluation mode
- train_mode()¶
Set in training mode
- predict(x: torch.Tensor, latent: bool = True, CG_tol: float = 0.1, full_cov: bool = False) Tuple[torch.Tensor, torch.Tensor]¶
Return mean and covariance at x
Input: x - tensor of size dim * N containing N inputs latent - latent = True -> using latent GP
latent = False -> using observed GP (incl. likelihood)
CG_tol - Conjugate Gradient tolerance for evaluation full_cov - full_cov = False -> Return only diagonal (variances)
Output: mean and covariance
- print_parameters()¶
Print actual (not raw) parameters
- save()¶
Save GP model parameters to self.path
- load()¶
Load GP model parameters from self.path