Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing LinRegHMM test #378

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions dynamax/hidden_markov_model/models/test_models.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import pytest
from datetime import datetime
import jax.numpy as jnp
import jax.random as jr
from jax import vmap
Expand All @@ -21,7 +20,7 @@
(models.LowRankGaussianHMM, dict(num_states=4, emission_dim=3, emission_rank=1), None),
(models.GaussianMixtureHMM, dict(num_states=4, num_components=2, emission_dim=3, emission_prior_mean_concentration=1.0), None),
(models.DiagonalGaussianMixtureHMM, dict(num_states=4, num_components=2, emission_dim=3, emission_prior_mean_concentration=1.0), None),
(models.LinearRegressionHMM, dict(num_states=4, emission_dim=3, input_dim=5), jnp.ones((NUM_TIMESTEPS, 5))),
(models.LinearRegressionHMM, dict(num_states=3, emission_dim=3, input_dim=5), jr.normal(jr.PRNGKey(0),(NUM_TIMESTEPS, 5))),
(models.LogisticRegressionHMM, dict(num_states=4, input_dim=5), jnp.ones((NUM_TIMESTEPS, 5))),
(models.MultinomialHMM, dict(num_states=4, emission_dim=3, num_classes=5, num_trials=10), None),
(models.PoissonHMM, dict(num_states=4, emission_dim=3), None),
Expand All @@ -31,7 +30,6 @@
@pytest.mark.parametrize(["cls", "kwargs", "inputs"], CONFIGS)
def test_sample_and_fit(cls, kwargs, inputs):
hmm = cls(**kwargs)
#key1, key2 = jr.split(jr.PRNGKey(int(datetime.now().timestamp())))
key1, key2 = jr.split(jr.PRNGKey(42))
params, param_props = hmm.initialize(key1)
states, emissions = hmm.sample(params, key2, num_timesteps=NUM_TIMESTEPS, inputs=inputs)
Expand Down
Loading