CtcGreedyDecoder

public final class CtcGreedyDecoder

Performs greedy decoding on the logits given in inputs.

A note about the attribute merge_repeated: if enabled, when consecutive logits' maximum indices are the same, only the first of these is emitted. Labeling the blank '*', the sequence "A B B * B B" becomes "A B B" if merge_repeated = True and "A B B B B" if merge_repeated = False.

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.

Nested Classes

class CtcGreedyDecoder.Options Optional attributes for CtcGreedyDecoder  

Constants

String OP_NAME The name of this op, as known by TensorFlow core engine

Public Methods

static <T extends TNumber> CtcGreedyDecoder<T>
create(Scope scope, Operand<T> inputs, Operand<TInt32> sequenceLength, Options... options)
Factory method to create a class wrapping a new CtcGreedyDecoder operation.
Output<TInt64>
decodedIndices()
Indices matrix, size `(total_decoded_outputs x 2)`, of a `SparseTensor`.
Output<TInt64>
decodedShape()
Shape vector, size `(2)`, of the decoded SparseTensor.
Output<TInt64>
decodedValues()
Values vector, size: `(total_decoded_outputs)`, of a `SparseTensor`.
Output<T>
logProbability()
Matrix, size `(batch_size x 1)`, containing sequence log-probabilities.
static CtcGreedyDecoder.Options
mergeRepeated(Boolean mergeRepeated)

Inherited Methods

Constants

public static final String OP_NAME

The name of this op, as known by TensorFlow core engine

Constant Value: "CTCGreedyDecoder"

Public Methods

public static CtcGreedyDecoder<T> create (Scope scope, Operand<T> inputs, Operand<TInt32> sequenceLength, Options... options)

Factory method to create a class wrapping a new CtcGreedyDecoder operation.

Parameters
scope current scope
inputs 3-D, shape: `(max_time x batch_size x num_classes)`, the logits.
sequenceLength A vector containing sequence lengths, size `(batch_size)`.
options carries optional attributes values
Returns
  • a new instance of CtcGreedyDecoder

public Output<TInt64> decodedIndices ()

Indices matrix, size `(total_decoded_outputs x 2)`, of a `SparseTensor`. The rows store: [batch, time].

public Output<TInt64> decodedShape ()

Shape vector, size `(2)`, of the decoded SparseTensor. Values are: `[batch_size, max_decoded_length]`.

public Output<TInt64> decodedValues ()

Values vector, size: `(total_decoded_outputs)`, of a `SparseTensor`. The vector stores the decoded classes.

public Output<T> logProbability ()

Matrix, size `(batch_size x 1)`, containing sequence log-probabilities.

public static CtcGreedyDecoder.Options mergeRepeated (Boolean mergeRepeated)

Parameters
mergeRepeated If True, merge repeated classes in output.