Skip to content

Commit

Permalink
Add init incorrect test
Browse files Browse the repository at this point in the history
  • Loading branch information
adonath committed Dec 17, 2024
1 parent fab4466 commit 677409b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/test_gmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ def test_create():
assert gmm.n_parameters == 17


def test_init_incorrect():
with pytest.raises(ValueError):
GaussianMixtureModelJax(
means=jnp.zeros((2, 3)),
covariances=jnp.zeros((2, 3, 3)),
weights=jnp.zeros((2,)),
)

with pytest.raises(ValueError):
GaussianMixtureModelJax(
means=jnp.zeros((1, 2, 3, 1)),
covariances=jnp.zeros((1, 2, 3, 3)),
weights=jnp.zeros((1, 1, 4, 1)),
)


def test_against_sklearn(gmm_jax):
x = np.array([
[1, 2, 3],
Expand Down

0 comments on commit 677409b

Please sign in to comment.