-
Notifications
You must be signed in to change notification settings - Fork 21
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
MethodError: no method matching bijector(::AbstractGPs.FiniteGP) #122
Comments
Yes, I think this would make sense and would fix the issues in your example. |
Seconded. We should definitely be doing that. I think when I implemented this originally I was unaware that |
Cool. Should I make a PR? |
Please :) |
By the way @willtebbutt @devmotion what is the reason for |
IMO technically it's not a GP, it's just a multivariate normal distribution which happens to be a projection of a GP. This projection can be applied to really any GP. Concrete implementations of GPs should be subtypes of AbstractGP, and then if you want to work with the finite-dimensional projection you construct a FiniteGP, e.g., with |
Ok so what you say is that |
Nothing prevents you from specializing methods of |
You mean I can define specific methods for EDIT: Once again maybe I am missing the point. I am going to check what WIll did for Stheno/TemporalGPs to understand it better |
Yes, exactly, you can define specific methods for If you implement |
Indeed -- this is what I found most convenient in practice. In
In addition to what's already been said to this point, the main reason that When I first implemented Stheno.jl, I actually didn't actually have a Additionally, the
I think this is only partly true. The interface itself is all about computing the statistics of finite-dimensional projections of infinite-dimensional objects ( GP packages that are happy to implement Are there any particular aspects of the interface that you're concerned about @theogf ? AFAICT, these are really the only things that you need to implement if you've got a standard kind of GP -- everything else can be built on top of that (e.g. pseudo-point approximations). |
Thanks for the lengthy description. This is not for nothing as I am making a PR for the docs to explain the interface :)
So the reason for my questioning is of course about the docs PR but also because I tried to make a quick implementation of VI for GP (using my augmented method but that's not relevant), and I was confused by the fact that when creating struct VariationalGP
lgp::LatentFiniteGP
mu::Vector
Sigma::Matrix
end It would be weird to make inherit from |
I see. Assuming that I've understood correctly, and your On the finite- vs infinite-dimensional stuff, I am curious though -- is there a particular reason that your |
Well in my view it represents a variational distribution |
Fair enough. So can I not use it to make predictions at test locations?
Okay, that's fair. There I guess there are two kind of infinite going on here. I'm referring to the infinite in the sense that you're distributing over functions, which are infinite-dimensional objects. In this sense, a linear regression model is infinite, its just that it's possible to parametrise said infinite-dimensional object using a finite-dimension vector. edit: so by infinite I mean that the index set / input domain isn't finite. |
Ok maybe it would be easier to understand what's NOT an infinite-dimensional object. Ok I think I get the grasp of it. Basically if you can consider the object as a map to a GP realization then it fits the description. |
Yeah, I think I would call a My conception of the f ~ GP(m, k)
y | f ~ D(f) for some family of distributions
Yeah, provided that the space your GP distributes over is infinite dimensional (I do think it's reasonable to refer to a multivariate Normal as a GP with a finite-dimensional index set) |
@theogf I've been thinking a bit about your Firstly, I'm assuming that the approximate posterior you're winding up with over your entire process q(f) = q(u) p(f_{\neq u} | u) i.e. the usual Titsias approximate posterior, but in your case the The way I'm interpreting your q(u) := N(u; mu, Sigma) and the Given this structure, I wonder whether we could implement your posterior in terms of existing data structures. Specifically, qf = LatentGP(
ApproxPosteriorGP(TheoApprox(), lgp.f, (mu=mu, Sigma=Sigma)),
lgp.lik,
lgp.Σy,
) Then you're back inside the qf = theos_approximate_inference(lgp::FiniteLatentGP, y::AbstractVector{<:Real}) that does inference using your methodology, and returns the approximate posterior in the proposed form. The reason I'm keen on this is that, assuming I've understood your approximation properly, that loads of approximate inference algorithms produce approximate posteriors that are representable by the family of processes that What do you think? edit: probably we'd want a different name from |
Reopening although I know the discussion diverged quite a lot. So to make things more concrete, I started to sketch a package for ApproximateGPs and implement my augmented approach : In my example I was not even considering Titsias, just variational GPs. Now I understand what is aimed at with So in your proposition, one would just give some inference functions that optimize the variational parameters and finally returned an About wrapping in a I will push till the end to get |
Apologies in advance, this is longer one.
It's really nice that the same form of the approximate posterior works for both regular variational GPs and the Titsias formulation of pseudo-point approximations, and that said approximate posterior GP is literally just a (slightly strange looking) GP. Also, yes, we always need more docs 😂
Agreed -- you can always pull the latent GP out of a
We shouldn't need a qf = approx_posterior(MyFancyPosteriorApproximationMethod(), lgp_x::FiniteLatentGP, y::AbstractVector)
marginals(qf(X*))
rand(qf(X*)) Am I missing anything here? Regarding hyperparameter optimisation, I think we have quite different API preferences, and I would like to figure out whether it's possible to support both. Specifically, I get the impression that you favour a mutating As an example of the kind of API that I would like to have, lets just consider approximate inference algorithms where the basic scheme for doing inference and hyperparameter learning is
There are obviously other kinds of algorithms which, for example, jointly update the variational and kernel parameters at the same time, but lets stick with this for now because it's simple. I'm also going to be assuming that we're not mini-batching. To implement an algorithm like the one described above, you need two functions:
Given these components, you can build a learning algorithm using e.g. I think you could also use these functions as building blocks inside a What do you think?
😂 |
Hey all,
first of all, great package! I work a lot with Turing and now try to add GPs in order to estimate latent functions. That said, the simple example below breaks
As a workaround, I can define a struct that inherits from AbstractMvNormal and everything works fine:
Thats not a serious issue but, as a beginner to both Turing and AbstractGPs, it took me a while to figure out the problem. It is also somewhat inconsistent in the case of Stheno: With the recent PR, sampling of sparse latent GPs with Stheno works out of the box but, sampling from a non-sparse GP has the same issue as above since the implementation is based on AbstractGPs.
Do you think, it would be possible to derive GPs from AbstractMvNormal instead of ContinuousMultivariateDistribution (at least in the case of Gaussian likelihoods) ?
The text was updated successfully, but these errors were encountered: