Skip to content
This repository has been archived by the owner on Jul 14, 2024. It is now read-only.

viterbi is broken? #48

Open
murphyk opened this issue May 13, 2022 · 4 comments
Open

viterbi is broken? #48

murphyk opened this issue May 13, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@murphyk
Copy link
Member

murphyk commented May 13, 2022

Old figure
Screen Shot 2022-05-13 at 8 48 07 AM
new one is different

https://github.com/probml/JSL/blob/main/jsl/demos/hmm_casino.py

@gerdm gerdm added the bug Something isn't working label May 13, 2022
@murphyk
Copy link
Member Author

murphyk commented May 13, 2022

The current version of the code gives the attached result, which seems wrong.
(I feel like we fixed this issue in the past, and we are repeating ourselves here... Badly need unit tests!!!)

Screen Shot 2022-05-13 at 12 42 11 PM

.

@maheswarantp
Copy link

I could help writing the unit tests, if needed.

@karalleyna
Copy link
Collaborator

karalleyna commented May 18, 2022

I think our previous code(GSoC code before being added to distrax) discarded the backward step of Viterbi. Hence, it was not correct. Also, the difference between plots came from the fact that we were using distax.HMM for the hmm_casino demo rather than our previous lib. So, if there was a bug, it should have been of distrax.HMM. So, I run this demo using hmmlearn and it produced the figure below(which is the same). So, distrax.HMM does not have any bug. Also, I changed this demo in a way that it is using hmm_lib now and added unit tests which compare tfd.HMM with our HMM model.
image

@murphyk
Copy link
Member Author

murphyk commented May 19, 2022

@karalleyna , where was the bug?
Also please convert https://github.com/probml/JSL/blob/main/jsl/hmm/hmm_lib_test.py to use pytest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants