Viterbi Assignment - Initialization Notes

I’m working through the Course 2 Week 2 notebook assignment. Reading the portion summarizing how the Viterbi Initialization works. Seeing the following:

Conceptually, it looks like this:
\textrm{best_probs}[s_{idx}, i] = \mathbf{A}[s_{idx}, i] \times \mathbf{B}[i, corpus[0] ]

Still wrapping my head around the initialization algorithm, but this seems like a typo to me. Shouldn’t it be:
Conceptually, it looks like this:

\textrm{best_probs}[i, 0] = \mathbf{A}[s_{idx}, i] \times \mathbf{B}[i, vocab[corpus[0]] ]

Hi @Brendan_McNamara

Yes, you are correct, the line should be fixed the way you suggested:

  • should be vocab[corpus[0]] → 8614, instead of corpus[0] → “The”
  • best_probs[i,0] is for initial probabilities, while best_probs[sidx,i] is wrong

The following line (when working with logs) in the instructions confirms it:

𝑏𝑒𝑠𝑡_𝑝𝑟𝑜𝑏𝑠[𝑖,0]=𝑙𝑜𝑔(𝐴[𝑠𝑖𝑑𝑥,𝑖])+𝑙𝑜𝑔(𝐵[𝑖,𝑣𝑜𝑐𝑎𝑏[𝑐𝑜𝑟𝑝𝑢𝑠[0]]

I will submit it for correction :+1: