Open utterances-bot opened 3 years ago
Thanks for your work and time spent here! I tried to run your code but it seems to fail here:
---> 25 mu_new = max_vals * emission_probs[:, observed_state]
operands could not be broadcast together with shapes (2,) (3,)
@afogarty85 yep, seems that
max_seq, seq_prob = viterbi(
transition_probs,
emission_probs,
init_hidden_probs,
observed_states,
)
should've been
max_seq, seq_prob = viterbi(
emission_probs,
transition_probs,
init_hidden_probs,
observed_states,
)
per the function arguments. Just fixed this typo, thanks for pointing it out!
Coding the Viterbi Algorithm in Numpy | Ben Bolte's Blog
https://ben.bolte.cc/viterbi