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

Fix failing LinRegHMM test #378

merged 1 commit into from
Oct 15, 2024

Conversation

gileshd
Copy link
Collaborator

@gileshd gileshd commented Sep 12, 2024

Summary

This PR changes the parameters of the LinearRegressionHMM test to prevent it failing.

Details

At present the LinearRegressionHMM test_sample_and_fit test is failing. The monotonically_increasing assertion is failing as the log likelihoods quickly become jnp.nan.

I think this is fundamentally a question of the stability of the linear solve. I have made some changes to the inputs which are hopefully more robust to solving.

Changes:

  • Replace jnp.ones input with jr.normal.
  • Reduce size of hidden state to 3.

There are likely more principled ways of choosing a more robust test case but in the interest of getting the test to pass I think it is helpful to make a simple change quickly.

Additional changes:

  • Remove unused datetime import and commented lines.

Changes:
- Replace `jnp.ones` input with `jr.normal`.
- Reduce size of hidden state to 3.
- Remove unused `datetime` import and commented lines.

Fundamentally the problem is that the solve step can be unstable. This
does not resolve that but instead chooses a set up which is less
vulnerable to the instability.
@gileshd gileshd self-assigned this Sep 12, 2024
@gileshd gileshd merged commit 1cd9a96 into main Oct 15, 2024
2 checks passed
@slinderman
Copy link
Collaborator

Sorry to miss this review request, @gileshd. Thanks for fixing the test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants