Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ziatdinovmax committed Jan 5, 2024
1 parent 2e2b4cf commit 216e0c5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/test_uigp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import sys
import pytest
import numpy as onp
import jax.numpy as jnp
import jax
import numpyro
import numpyro.distributions as dist
from numpy.testing import assert_equal, assert_array_equal, assert_

sys.path.insert(0, "../gpax/")

from gpax.models.uigp import UIGP
from gpax.utils import get_keys


def get_dummy_data():
X = onp.linspace(1, 2, 8) + 0.1 * onp.random.randn(8,)
X_prime = onp.random.normal(X, 0.1)
y = (10 * X_prime**2)
return jnp.array(X_prime), jnp.array(y)


def test_fit():
rng_key = get_keys()[0]
X, y = get_dummy_data()
m = UIGP(1, 'RBF')
m.fit(rng_key, X, y, num_warmup=10, num_samples=10)
assert m.mcmc is not None

0 comments on commit 216e0c5

Please sign in to comment.