We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b0aee5 commit 6550fabCopy full SHA for 6550fab
ocrolib/lstm.py
@@ -751,7 +751,10 @@ def forward_algorithm(match,skip=-5.0):
751
# from how well the symbols match the network output.
752
for i in range(0,len(match)):
753
w = roll(v,1).copy()
754
+ # extra cost for skipping initial symbols
755
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
758
v = log_add(log_mul(v,match[i]),log_mul(w,match[i]))
759
result.append(v)
760
return array(result,'f')
0 commit comments