Skip to content

Learning distributions over hyperparameters #1508

Answered by gpleiss
interseismic asked this question in Q&A
Discussion options

You must be logged in to vote

Unfortunately, I think full Bayesian inference right now only works for exact GP...

A simple (but maybe hacky) solution is to make the GPyTorch length scale un-learnable

model.covar_module.base_kernel.raw_lengthscale.requires_grad_(False)
Instead have the model/guide functions pre-process your data by dividing by a lengthscale.

model

lengthscale = pyro.sample("lengthscale", lengthscale_prior_dist)
x = x / lengthscale

guide

lengthscale = pyro.sample("lengthscale", lengthscale_variational_dist)
In the evaluation code, you'd have to be sure to appropriately pre-process your data:

lengthscale = lengthscale_variational_dist()
times = times / lengthscale
function_dist = model(times)
intensity_s…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by interseismic
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants