tf.nn.ctc_greedy_decoder( inputs, sequence_length, merge_repeated=True )
See the guide: Neural Network > Connectionist Temporal Classification (CTC)
Performs greedy decoding on the logits given in input (best path).
Note: Regardless of the value of merge_repeated, if the maximum index of a given time and batch corresponds to the blank index
(num_classes - 1), no new element is emitted.
True, merge repeated classes in output. This means that if consecutive logits' maximum indices are the same, only the first of these is emitted. The sequence
A B B * B * B (where '*' is the blank label) becomes
A B B Bif
A B B B Bif
[max_time, batch_size, num_classes]. The logits.
int32vector containing sequence lengths, having size
merge_repeated: Boolean. Default: True.
(decoded, neg_sum_logits) where
decoded: A single-element list.
decoded is an
SparseTensor containing the decoded outputs s.t.:
decoded.indices: Indices matrix
(total_decoded_outputs, 2). The rows store:
decoded.values: Values vector, size
(total_decoded_outputs). The vector stores the decoded classes.
decoded.dense_shape: Shape vector, size
(2). The shape values are:
(batch_size x 1) containing, for the sequence found, the negative of the sum of the greatest logit at each timeframe.
© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.