def __init__(self, inducing_points, learn_locs=True): variational_distribution = CholeskyVariationalDistribution(inducing_points.size(-1)) variational_strategy = WhitenedVariationalStrategy( self, inducing_points, variational_distribution, learn_inducing_locations=learn_locs ) super(SVGPRegressionModel, self).__init__(variational_strategy) self.mean_module = gpytorch.means.ConstantMean() self.covar_module = gpytorch.kernels.ScaleKernel( gpytorch.kernels.RBFKernel(lengthscale_prior=gpytorch.priors.SmoothedBoxPrior(0.001, 1.0, sigma=0.1)) )
def __init__(self, inducing_points): variational_distribution = CholeskyVariationalDistribution( inducing_points.size(0)) variational_strategy = WhitenedVariationalStrategy( self, inducing_points, variational_distribution, learn_inducing_locations=True) super(GPRegressionLayer, self).__init__(variational_strategy) self.mean_module = gpytorch.means.ConstantMean() self.covar_module = gpytorch.kernels.ScaleKernel( gpytorch.kernels.RBFKernel())