Skip to content

Commit 6550fab

Browse files
author
tmb
committed
comments
1 parent 9b0aee5 commit 6550fab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ocrolib/lstm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,10 @@ def forward_algorithm(match,skip=-5.0):
751751
# from how well the symbols match the network output.
752752
for i in range(0,len(match)):
753753
w = roll(v,1).copy()
754+
# extra cost for skipping initial symbols
754755
w[0] = skip*i
756+
# total cost is match cost of staying in same state
757+
# plus match cost of making a transition into the next state
755758
v = log_add(log_mul(v,match[i]),log_mul(w,match[i]))
756759
result.append(v)
757760
return array(result,'f')

0 commit comments

Comments
 (0)