This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Compute score for decoded text in a CTC-trained neural network using TensorFlow: | |
1. decode text with best path decoding (or some other decoder) | |
2. feed decoded text into loss function | |
3. loss is negative logarithm of probability | |
Example data: two time-steps, 2 labels (0, 1) and the blank label (2). | |
Decoding results in [0] (i.e. string containing one entry for label 0). | |
The probability is the sum over all paths yielding [0], these are: [0, 0], [0, 2], [2, 0] | |
with probability |