Skip to content

Commit

Permalink
Merge pull request #271 from JaxGaussianProcesses/isotropic_bug
Browse files Browse the repository at this point in the history
Add isotropy test
  • Loading branch information
daniel-dodd authored May 18, 2023
2 parents 57ac3f9 + 4b4aba5 commit a1cc2e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_kernels/test_stationary.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,13 @@ def test_spectral_density(self):
assert sdensity.loc == jnp.array(0.0)
assert sdensity.scale == jnp.array(1.0)

@pytest.mark.parametrize("dim", [1, 3], ids=lambda x: f"dim={x}")
def test_isotropic(self, dim: int):
# Initialise kernel
kernel: AbstractKernel = self.kernel(active_dims=list(range(dim)))
if self.kernel not in [White]:
assert kernel.lengthscale.shape == ()


def prod(inp):
return [dict(zip(inp.keys(), values)) for values in product(*inp.values())]
Expand Down

0 comments on commit a1cc2e2

Please sign in to comment.