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

Gaussian Process support #7

Open
brendanhasz opened this issue Oct 31, 2019 · 0 comments
Open

Gaussian Process support #7

brendanhasz opened this issue Oct 31, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request
Projects

Comments

@brendanhasz
Copy link
Owner

Currently I can't think of a good way to fit nonparametric models (like Gaussian processes) into the ProbFlow framework. For example, the probflow.model.predict interface would have to change, and all the methods which depend on it, since you'd need both the x and y training data as well as the x test data.

That said, you can still use ProbFlow to fit GP kernel and/or latent parameters. For example, fitting the kernel parameters would look something like:

import tensorflow_probability as tfp
import probflow as pf

class GP(pf.Model):

    def __init__(self):
        self.amplitude = pf.ScaleParameter()
        self.length_scale = pf.ScaleParameter()
        self.var = pf.ScaleParameter()

    def __call__(self, x):
        kernel = tfp.positive_semidefinite_kernels.ExponentiatedQuadratic(
            amplitude=self.amplitude(),
            length_scale=self.length_scale())
        return tfp.distributions.GaussianProcess(kernel, x, 
            observation_noise_variance=self.var())

Which can be fit just fine, but then runs into issues if you were to call predict on the model, since the model doesn't store the training data.

For now I've put further support for GPs on the "out-of-scope" list, but if anyone has ideas for how to make GPs work with the rest of the framework (say, with probflow.model.predict), and want to see that be part of the package, I'm definitely open to discussion!

@brendanhasz brendanhasz added the enhancement New feature or request label Oct 31, 2019
@brendanhasz brendanhasz self-assigned this Oct 31, 2019
@brendanhasz brendanhasz added this to To do in backlog Jul 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
backlog
  
To do
Development

No branches or pull requests

1 participant