Skip to content

Commit 2e31094

Browse files
committed
token passing: blank must be last char in rnn output matrix
1 parent 2936b8b commit 2e31094

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/TokenPassing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def log(val):
5252
return float('-inf')
5353

5454

55-
def ctcTokenPassing(mat, classes, charWords, blankIdx=None):
55+
def ctcTokenPassing(mat, classes, charWords):
5656
"implements CTC Token Passing Algorithm as shown by Graves (Dissertation, p67-69)"
57-
blankIdx = len(classes) if blankIdx is None else blankIdx
57+
blankIdx = len(classes)
5858
maxT, _ = mat.shape
5959

6060
# special s index for beginning and end of word
@@ -97,7 +97,6 @@ def ctcTokenPassing(mat, classes, charWords, blankIdx=None):
9797

9898
for wIdx in sortedWordIdx:
9999
wPrime = primeWords[wIdx]
100-
w = words[wIdx]
101100

102101
# 15-17
103102
# if bigrams should be used, these lines have to be adapted

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