NLP C2_W2 # UNQ_C7 GRADED FUNCTION: viterbi_backward

There are a few places across the DLAI programming exercises where None shouldn’t be replaced. However, there is usually an inline comment or warning. After staring at this for a good while

    # Initialize array z, same length as the corpus
    z = [None] * m

lines 11 and 12 in the viterbi_backward()

I conclude that this is one of those places (but without the warning comment). Am I missing something, or that None should be left alone?

Leave it alone.
There’s another line down the line: pred = [None] * m. Leave it alone as well.

1 Like

This was helpful for me, my notebook was consistently running out of memory & restarting until i saw this hint. I restore it None, then it works fine. Thanks for this

1 Like