Giter Club home page Giter Club logo

Comments (8)

ziatdinovmax avatar ziatdinovmax commented on May 23, 2024 1

I guess the predict method should just always output predictive mean and variance. Then we can have another method specific to HMC-based GPs that returns samples from the HMC posterior.

from gpax.

ziatdinovmax avatar ziatdinovmax commented on May 23, 2024 1

In fact, we can have .sample_from_posterior() method for all GPs that it will output samples of the shape (M, N, len(X_new)). For the HMC-based GPs, M is equal to the number of HMC posterior samples and for SVI-based GPs M is equal to 1.

from gpax.

matthewcarbone avatar matthewcarbone commented on May 23, 2024

Happy to attempt a fix if you'd like.

from gpax.

ziatdinovmax avatar ziatdinovmax commented on May 23, 2024

In the beginning, both ExactGP and viGP used to output identical shapes. However, while y_sampled in ExactGP makes sense since each sample comes from a different HMC sample with kernel hyperparameters, the y_sampled in viGP is sampled from the same single point estimate of the kernel hyperparameters, which makes it pretty noisy. Hence, for practical purposes, viGP returns the predictive variance values directly.

That said, there is certainly an "asymmetry" between fully Bayesian and variational inference tools currently available. I need to think a bit more about how to address it from the design point of view.

from gpax.

matthewcarbone avatar matthewcarbone commented on May 23, 2024

@ziatdinovmax I see what you're saying but ultimately doesn't it make more sense from a design standpoint to have a common interface? It's going to make building tools on top of what you already have really difficult if each of the GP's predict method returns something different.

IMO making this really clear in the docs but implementing the consistent method is the way to go. That way, a GP that inherits some base ABC has totally known behavior when calling predict (which naturally will make e.g. building the campaigning library much easier).

from gpax.

ziatdinovmax avatar ziatdinovmax commented on May 23, 2024

@matthewcarbone - adding it to the v0.3 'milestone' per our discussion

from gpax.

matthewcarbone avatar matthewcarbone commented on May 23, 2024

@ziatdinovmax yup sounds good. To be clear this would actually be a backwards-incompatible change (technically), since the shape of the predict method would change. Should we make such a change, or should we add a new method which returns a consistent shape between the GP methods?

from gpax.

matthewcarbone avatar matthewcarbone commented on May 23, 2024

Perfect, I really like the idea of sample_from_posterior().

from gpax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.