Content deleted Content added
→Forward probabilities: i usually refers to the row vector index, and j the column vector index. the previous i, j convention did not agree with the convention used on the baum-welch alg wiki page, which references this page |
→Pseudocode: Follow WP:ALGO |
||
Line 293:
==Pseudocode==
'''algorithm''' forward_backward '''is'''
Backward(guessState, sequenceIndex):▼
'''input:''' guessState
if sequenceIndex is past the end of the sequence, return 1▼
if (guessState, sequenceIndex) has been seen before, return saved result▼
'''output:''' ''result''
result = 0▼
for each neighboring state n:▼
result = result + (transition probability from guessState to ▼
'''return''' 1
n given observation element at sequenceIndex)▼
▲ * Backward(n, sequenceIndex+1)
'''return''' saved result▼
▲ return result
▲ ''result'' := 0
▲ '''for each''' neighboring state n:
▲ ''result'' := result + (transition probability from ''guessState'' to
▲ n given observation element at ''sequenceIndex'')
× Backward(n, ''sequenceIndex'' + 1)
'''return''' ''result''
==Python example==
|