Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tmb committed Sep 5, 2013
1 parent 6550fab commit 062dc77
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ocrolib/lstm.py
Original file line number Diff line number Diff line change
Expand Up @@ -801,8 +801,9 @@ def ctc_align_targets(outputs,targets,threshold=100.0,verbose=0,debug=0,lo=1e-5)
epath /= where(l==0.0,1e-9,l)

# The previous computation gives us an alignment between input time
# and output sequence position; however, we actually want the posterior
# probability distribution at each time step. This dot product gives
# and output sequence position as posteriors over states.
# However, we actually want the posterior probability distribution over
# output classes at each time step. This dot product gives
# us that result. We renormalize again afterwards.
aligned = maximum(lo,dot(epath,targets))
l = sum(aligned,axis=1)[:,newaxis]
Expand Down

0 comments on commit 062dc77

Please sign in to comment.