Class CtcGreedyDecoder<T extends TNumber>

java.lang.Object
org.tensorflow.op.RawOp
org.tensorflow.op.nn.CtcGreedyDecoder<T>
All Implemented Interfaces:
Op

@Operator(group="nn") public final class CtcGreedyDecoder<T extends TNumber> extends RawOp
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.

  • Field Details

  • Constructor Details

    • CtcGreedyDecoder

      public CtcGreedyDecoder(Operation operation)
  • Method Details

    • create

      @Endpoint(describeByClass=true) public static <T extends TNumber> CtcGreedyDecoder<T> create(Scope scope, Operand<T> inputs, Operand<TInt32> sequenceLength, CtcGreedyDecoder.Options... options)
      Factory method to create a class wrapping a new CTCGreedyDecoder operation.
      Type Parameters:
      T - data type for CTCGreedyDecoder output and operands
      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 attribute values
      Returns:
      a new instance of CtcGreedyDecoder
    • mergeRepeated

      public static CtcGreedyDecoder.Options mergeRepeated(Boolean mergeRepeated)
      Sets the mergeRepeated option.
      Parameters:
      mergeRepeated - If True, merge repeated classes in output.
      Returns:
      this Options instance.
    • blankIndex

      public static CtcGreedyDecoder.Options blankIndex(Long blankIndex)
      Sets the blankIndex option.
      Parameters:
      blankIndex - the blankIndex option
      Returns:
      this Options instance.
    • decodedIndices

      public Output<TInt64> decodedIndices()
      Gets decodedIndices. Indices matrix, size (total_decoded_outputs x 2), of a SparseTensor<int64, 2>. The rows store: [batch, time].
      Returns:
      decodedIndices.
    • decodedValues

      public Output<TInt64> decodedValues()
      Gets decodedValues. Values vector, size: (total_decoded_outputs), of a SparseTensor<int64, 2>. The vector stores the decoded classes.
      Returns:
      decodedValues.
    • decodedShape

      public Output<TInt64> decodedShape()
      Gets decodedShape. Shape vector, size (2), of the decoded SparseTensor. Values are: [batch_size, max_decoded_length].
      Returns:
      decodedShape.
    • logProbability

      public Output<T> logProbability()
      Gets logProbability. Matrix, size (batch_size x 1), containing sequence log-probabilities.
      Returns:
      logProbability.