Use variational posteriors or viterbi algorithm to infer the best latent states of a Markov model (e.g. HMM)?


The deep Markov model tutorial:

I am thinking how to use the trained deep Markov model to infer the best states for each instance.
I thought two ways, maybe you would have the clue which one is better or more robust.

  • use the transition and emission learned in the model, and the Viterbi algorithm is used to infer the best states.
  • use the variational posteriors directly, i.e. p(z_{t-1} | z_t, x) in the guide.


The Viterbi algorithm (via infer_discrete) will be much faster than using variational posteriors directly.


Hi Fritzo, many thanks for your reply. I will try infer_discrete first. :slight_smile: