Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaspinder committed Nov 30, 2023
1 parent 65c29fb commit 25db829
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ started is to
As a contributor to GPJax, you are expected to abide by our [code of
conduct](docs/CODE_OF_CONDUCT.md). If you feel that you have either experienced or
witnessed behaviour that violates this standard, then we ask that you report any such
<<<<<<< HEAD
behaviours though [this form](https://jaxgaussianprocesses.com/contact/) or reach out to
=======
behaviours through [this form](https://jaxgaussianprocesses.com/contact/) or reach out to
>>>>>>> ac475762faa0cb9c64a773d5d9d3506d1a3ebdf2
one of the project's [_gardeners_](https://docs.jaxgaussianprocesses.com/GOVERNANCE/#roles).

Feel free to join our [Slack
Expand Down Expand Up @@ -139,17 +135,10 @@ D = gpx.Dataset(X=x, y=y)
# Construct the prior
meanf = gpx.mean_functions.Zero()
kernel = gpx.kernels.RBF()
<<<<<<< HEAD
prior = gpx.gps.Prior(mean_function=meanf, kernel = kernel)

# Define a likelihood
likelihood = gpx.likelihoods.Gaussian(num_datapoints = n)
=======
prior = gpx.Prior(mean_function=meanf, kernel=kernel)

# Define a likelihood
likelihood = gpx.Gaussian(num_datapoints=n)
>>>>>>> ac475762faa0cb9c64a773d5d9d3506d1a3ebdf2

# Construct the posterior
posterior = prior * likelihood
Expand Down
9 changes: 7 additions & 2 deletions tests/test_objectives.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import gpjax as gpx
from gpjax.dataset import Dataset
from gpjax.gps import Prior
from gpjax.likelihoods import Gaussian
from gpjax.objectives import (
ELBO,
AbstractObjective,
Expand Down Expand Up @@ -90,7 +92,8 @@ def test_conjugate_loocv(

# Build model
p = Prior(
kernel=gpx.RBF(active_dims=list(range(num_dims))), mean_function=gpx.Constant()
kernel=gpx.kernels.RBF(active_dims=list(range(num_dims))),
mean_function=gpx.mean_functions.Constant(),
)
likelihood = Gaussian(num_datapoints=num_datapoints)
post = p * likelihood
Expand Down Expand Up @@ -176,7 +179,9 @@ def test_collapsed_elbo(
assert evaluation.shape == ()

# Data on the full dataset should be the same as the marginal likelihood
q = gpx.CollapsedVariationalGaussian(posterior=p * likelihood, inducing_inputs=D.X)
q = gpx.variational_families.CollapsedVariationalGaussian(
posterior=p * likelihood, inducing_inputs=D.X
)
mll = ConjugateMLL(negative=negative)
expected_value = mll(p * likelihood, D)
actual_value = negative_elbo(q, D)
Expand Down

0 comments on commit 25db829

Please sign in to comment.