If merge_repeated is 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 B if merge_repeated=True.
A B B B B if merge_repeated=False.
Args
inputs
3-D floatTensor sized [max_time, batch_size, num_classes].
The logits.
sequence_length
1-D int32 vector containing sequence lengths, having size
[batch_size].
merge_repeated
Boolean. Default: True.
Returns
A tuple (decoded, neg_sum_logits) where
decoded
A single-element list. decoded[0]
is an SparseTensor containing the decoded outputs s.t.:
decoded.indices: Indices matrix (total_decoded_outputs, 2).
The rows store: [batch, time].
decoded.values: Values vector, size (total_decoded_outputs).
The vector stores the decoded classes.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.nn.ctc_greedy_decoder\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/nn/ctc_greedy_decoder) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/ops/ctc_ops.py#L209-L255) |\n\nPerforms greedy decoding on the logits given in input (best path).\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.nn.ctc_greedy_decoder`](/api_docs/python/tf/nn/ctc_greedy_decoder)\n\n\u003cbr /\u003e\n\n tf.nn.ctc_greedy_decoder(\n inputs, sequence_length, merge_repeated=True\n )\n\n| **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.\n\nIf `merge_repeated` is `True`, merge repeated classes in output.\nThis means that if consecutive logits' maximum indices are the same,\nonly the first of these is emitted. The sequence `A B B * B * B` (where '\\*'\nis the blank label) becomes\n\n- `A B B B` if `merge_repeated=True`.\n- `A B B B B` if `merge_repeated=False`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------|-------------------------------------------------------------------------------|\n| `inputs` | 3-D `float` `Tensor` sized `[max_time, batch_size, num_classes]`. The logits. |\n| `sequence_length` | 1-D `int32` vector containing sequence lengths, having size `[batch_size]`. |\n| `merge_repeated` | Boolean. Default: True. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| A tuple `(decoded, neg_sum_logits)` where ||\n| `decoded` | A single-element list. `decoded[0]` is an `SparseTensor` containing the decoded outputs s.t.: \u003cbr /\u003e `decoded.indices`: Indices matrix `(total_decoded_outputs, 2)`. The rows store: `[batch, time]`. `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, max_decoded_length]` |\n| `neg_sum_logits` | A `float` matrix `(batch_size x 1)` containing, for the sequence found, the negative of the sum of the greatest logit at each timeframe. |\n\n\u003cbr /\u003e"]]