Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
tmb committed Sep 5, 2013

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9b0aee5 commit 6550fab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ocrolib/lstm.py
Original file line number Diff line number Diff line change
@@ -751,7 +751,10 @@ def forward_algorithm(match,skip=-5.0):
# from how well the symbols match the network output.
for i in range(0,len(match)):
w = roll(v,1).copy()
# extra cost for skipping initial symbols
w[0] = skip*i
# total cost is match cost of staying in same state
# plus match cost of making a transition into the next state
v = log_add(log_mul(v,match[i]),log_mul(w,match[i]))
result.append(v)
return array(result,'f')

0 comments on commit 6550fab

Please sign in to comment.