MXFusion icon indicating copy to clipboard operation
MXFusion copied to clipboard

GP Likelihood classes

Open marpulli opened this issue 5 years ago • 0 comments

Is your feature request related to a problem? Please describe. The SVGP and DGP modules should be able to work with alternative likelihoods. They are both currently implemented for Gaussian likelihoods only. The ability to switch out likelihoods would make things like #126 much simpler with less code duplication.

Describe the solution you'd like Currently:

m = Model()
m.X = Variable()
m.noise_var = Variable(transformation=PositiveTransformation())
m.Y = SVGP.define_variable(m.X, kern, m.noise_var...)

I'd like something more like

m = Model()
m.X = Variable()
m.noise_var = Variable(transformation=PositiveTransformation())
m.likelihood = NormalGPLikelihood(variance)
# This could also be: 
# m.likelihood = BernoulliGPLikelihood()
m.Y = SVGP.define_variable(m.X, kern, m.likelihood...)

These likelihoods would need to be able to compute: where p(f) is Gaussian.

class BernoulliGPLikelihood(GPLikelihood):
    # This class would also contain the transformation of the 
    # latent function to the interval [0, 1] I think
   def expectation(self, mean, variance, data): 
       # This method would implement the quadrature rule to do this here

class NormalGPLikelihood(GPLikelihood):
   def expectation(self, mean, variance, data): # think of a better name!
       # This method could use the analytically equation

Describe alternatives you've considered Creating a new class might not be necessary, we might be able to reuse the current distribution objects directly.

I would be happy to implement this, if we come up with a design which people are happy with first.

marpulli avatar Jul 12 '19 12:07 marpulli