Skip to content

Commit

Permalink
add riemann gp models
Browse files Browse the repository at this point in the history
  • Loading branch information
William Wilkinson authored and William Wilkinson committed Dec 18, 2023
1 parent 3f40913 commit 0281955
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions bayesnewton/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,23 @@ def __init__(self, kernel, likelihood, X, Y):
super().__init__(kernel, likelihood, X, Y)


class VariationalRiemannGP(VariationalInferenceRiemann, GaussianProcess):
"""
Variational Gaussian process [1], adapted to use conjugate computation VI [2] with PSD guarantees [3].
:param kernel: a kernel object
:param likelihood: a likelihood object
:param X: inputs
:param Y: observations
[1] Opper, Archambeau: The Variational Gaussian Approximation Revisited, Neural Computation, 2009
[2] Khan, Lin: Conugate-Computation Variational Inference - Converting Inference in Non-Conjugate Models in to
Inference in Conjugate Models, AISTATS 2017
[3] Lin, Schmidt & Khan: Handling the Positive-Definite Constraint in the Bayesian Learning Rule, ICML 2020
"""
def __init__(self, kernel, likelihood, X, Y):
super().__init__(kernel, likelihood, X, Y)


class SparseVariationalGP(VariationalInference, SparseGaussianProcess):
"""
Sparse variational Gaussian process (SVGP) [1], adapted to use conjugate computation VI [2]
Expand All @@ -76,6 +93,25 @@ def __init__(self, kernel, likelihood, X, Y, Z, opt_z=False):
super().__init__(kernel, likelihood, X, Y, Z, opt_z)


class SparseVariationalRiemannGP(VariationalInferenceRiemann, SparseGaussianProcess):
"""
Sparse variational Gaussian process (SVGP) [1], adapted to use conjugate computation VI [2] with PSD guarantees [3].
:param kernel: a kernel object
:param likelihood: a likelihood object
:param X: inputs
:param Y: observations
:param Z: inducing inputs
:param opt_z: boolean determining whether to optimise the inducing input locations
[1] Hensman, Matthews, Ghahramani: Scalable Variational Gaussian Process Classification, AISTATS 2015
[2] Khan, Lin: Conugate-Computation Variational Inference - Converting Inference in Non-Conjugate Models in to
Inference in Conjugate Models, AISTATS 2017
[3] Lin, Schmidt & Khan: Handling the Positive-Definite Constraint in the Bayesian Learning Rule, ICML 2020
"""
def __init__(self, kernel, likelihood, X, Y, Z, opt_z=False):
super().__init__(kernel, likelihood, X, Y, Z, opt_z)


SVGP = SparseVariationalGP


Expand Down

0 comments on commit 0281955

Please sign in to comment.