JSL
JSL copied to clipboard
viterbi is broken?
Old figure
new one is different
https://github.com/probml/JSL/blob/main/jsl/demos/hmm_casino.py
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!!!)

I could help writing the unit tests, if needed.
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.
@karalleyna , where was the bug? Also please convert https://github.com/probml/JSL/blob/main/jsl/hmm/hmm_lib_test.py to use pytest.