Skip to content

Commit

Permalink
Seed flaky TestHSGP.test_prior
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardoV94 committed Aug 16, 2023
1 parent 39136a5 commit 5add5de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/gp/test_hsgp_approx.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def test_parametrization_drop_first(self, model, cov_func, X1, drop_first):
assert n_coeffs == n_basis, "one was dropped when it shouldn't have been"

@pytest.mark.parametrize("parameterization", ["centered", "noncentered"])
def test_prior(self, model, cov_func, X1, parameterization):
def test_prior(self, model, cov_func, X1, parameterization, rng):
"""Compare HSGP prior to unapproximated GP prior, pm.gp.Latent. Draw samples from the
prior and compare them using MMD two sample test. Tests both centered and non-centered
parameterizations.
Expand All @@ -178,7 +178,7 @@ def test_prior(self, model, cov_func, X1, parameterization):
gp = pm.gp.Latent(cov_func=cov_func)
f2 = gp.prior("f2", X=X1)

idata = pm.sample_prior_predictive(samples=1000)
idata = pm.sample_prior_predictive(samples=1000, random_seed=rng)

samples1 = az.extract(idata.prior["f1"])["f1"].values.T
samples2 = az.extract(idata.prior["f2"])["f2"].values.T
Expand Down

0 comments on commit 5add5de

Please sign in to comment.