Skip to content

Commit 1892cc9

Browse files
committed
beam search: only normalize w.r.t. lengths if LM is used
1 parent cd5e3ea commit 1892cc9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/BeamSearch.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ def ctcBeamSearch(mat, classes, lm):
106106
# set new beam state
107107
last = curr
108108

109-
# normalise probabilities according to labeling length
110-
last.norm()
109+
# normalise probabilities according to labeling length if LM is used
110+
if lm:
111+
last.norm()
111112

112113
# sort by probability
113114
bestLabeling = last.sort()[0] # get most probable labeling

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy