It would be nice to have an example demonstrating how to learn GP hyperparameters in Pyro, using the GPyTorch implementation of GPs. We should be able to add a Pyro example/tutorial by forking the simple GP regression tutorial and replacing the torch optimization with Pyro optimization, possibly adding a prior.
cc @gpleiss @jacobrgardner @andrewgordonwilson
It was a great conversation! Because I didn't say much during the talk, I'd like to take this chance to share some of Pyro GP's features which might be helpful for your plan:
distributions and distributions.constraints modules.kernel.fix_param("lengthscale").From our discussion, I guess what currently lacked from Pyro GP are:
I have read the GPytorch's GP regression tutorial. It seems the first thing to do is to use pyro.module/pyro.random_model on model to register its parameter or Pyro.optim. The loss can be added to a Pyro model to be learned under SVI/HMC using Bernoulli trick. Then, the next thing is to replace/inherit gpytorch.priors.SmoothedBoxPrior to make it compatible with PyTorch/Pyro's Distribution (so log_lengthscale_prior can be learned using pyro.param/pyro.sample).
@fritzo I'm going to have a vacation with my family until the end of September, so I might not be active in the discussion for this integration.
Just to clarify, GPyTorch absolutely trains the network parameters and GP hyperparameters simultaneously. This is largely the point and strength of DKL. In the MNIST example we start by pretraining just to show it is possible, but then the model is trained jointly. In the LOVE + SKI notebook we demonstrate training a deep kernel model from scratch, and we have several DKL CIFAR10 and CIFAR100 models trained end to end from scratch.
Edit: If it is helpful, I just added a tutorial on training a DKL + DenseNet model from scratch on CIFAR10 and CIFAR 100 at https://github.com/cornellius-gp/gpytorch/blob/master/examples/DKL_DenseNet_CIFAR_Tutorial.ipynb 馃槂
@jacobrgardner Thanks for pointing out! I just took a look and was amazed by the performance in LOVE + SKI notebook. Well done!
@jacobrgardner has made a nice tutorial which shows how to do fully bayesian for GPyTorch models. For those who want speed, @martinjankowiak has also made a nice example using NumPyro.
I think we can close this issue now.
Hi there!
@jacobrgardner has made a nice tutorial which shows how to do fully bayesian for GPyTorch models. For those who want speed, @martinjankowiak has also made a nice example using NumPyro.
Unfortunately, both of these links are broken! Does anyone know where these notebooks could be found now...?
Most helpful comment
@jacobrgardner Thanks for pointing out! I just took a look and was amazed by the performance in LOVE + SKI notebook. Well done!