Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds 3 basic implementations of approximations for gp.Latent #3

Merged
merged 6 commits into from Jun 1, 2022

Conversation

bwengals
Copy link
Contributor

  • KarhunenLoeveExpansion (from @aseyboldt)
  • Projected process / DTC
  • Hilbert space GP (HSGP)

There's a notebook with a basic 1D demo of each.

The Karhunen-Loeve expansion GP and the DTC approximation both can take arbitrary covariance functions, while HSGP only works for stationary kernels with a defined spectral density. What is the best way to interface this with the way the kernel library is designed?

@fonnesbeck fonnesbeck self-assigned this Jan 11, 2022
@bwengals
Copy link
Contributor Author

bwengals commented Jan 20, 2022

At this point the ProjectedProcess / DTC and KarhunenLoeve implementations are feature complete I think (so not counting tests, docstrings).

The HSGP one is trickier since it requires the spectral density of the kernel. I'm not sure if the API should take string arguments (ie, "matern32") for kernels with spectral densities, or whether to expect and check for specific covariance inputs (ie eta**2 * pm.gp.cov.Matern32(input_dim=1, ls=2) and error otherwise). The HSGP also needs to be expanded to handle multidimensional inputs (input_dim > 1).

Also am not sure if there should be a factory function similar to pm.gp.MarginalApprox, so pm.gp.LatentApprox, that should return instances of the approx GPs, or whether the user should call them directly.

@bwengals bwengals marked this pull request as ready for review January 24, 2022 23:07

class ProjectedProcess(pm.gp.Latent):
## AKA: DTC
def __init__(self, n_inducing, *, mean_func=pm.gp.mean.Zero(), cov_func=pm.gp.cov.Constant(0.0)):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add type hints to public-facing API and at least simple docstrings. Can be done in a separate PR if you prefer.

@michaelosthege
Copy link
Member

@bwengals can you link to papers for the three approximations?

Does one of them correspond to the method from https://arxiv.org/pdf/2002.09309.pdf ?

I'm asking because I want to refer to these methods & implementations in my thesis...

@twiecki
Copy link
Member

twiecki commented May 30, 2022

Also, can we merge this?

@twiecki
Copy link
Member

twiecki commented Jun 1, 2022

Nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants