tf.raw_ops.CTCLossV2  |  TensorFlow v2.16.1 (original) (raw)

tf.raw_ops.CTCLossV2

Stay organized with collections Save and categorize content based on your preferences.

Calculates the CTC Loss (log probability) for each batch entry.

View aliases

Compat aliases for migration

SeeMigration guide for more details.

tf.compat.v1.raw_ops.CTCLossV2

tf.raw_ops.CTCLossV2(
    inputs,
    labels_indices,
    labels_values,
    sequence_length,
    preprocess_collapse_repeated=False,
    ctc_merge_repeated=True,
    ignore_longer_outputs_than_inputs=False,
    name=None
)

Also calculates

the gradient. This class performs the softmax operation for you, so inputs should be e.g. linear projections of outputs by an LSTM.

Args
inputs A Tensor of type float32. 3-D, shape: (max_time x batch_size x num_classes), the logits. Default blank label is 0 rather num_classes - 1.
labels_indices A Tensor of type int64. The indices of a SparseTensor<int32, 2>.labels_indices(i, :) == [b, t] means labels_values(i) stores the id for(batch b, time t).
labels_values A Tensor of type int32. The values (labels) associated with the given batch and time.
sequence_length A Tensor of type int32. A vector containing sequence lengths (batch).
preprocess_collapse_repeated An optional bool. Defaults to False. Scalar, if true then repeated labels are collapsed prior to the CTC calculation.
ctc_merge_repeated An optional bool. Defaults to True. Scalar. If set to false, during CTC calculation repeated non-blank labels will not be merged and are interpreted as individual labels. This is a simplified version of CTC.
ignore_longer_outputs_than_inputs An optional bool. Defaults to False. Scalar. If set to true, during CTC calculation, items that have longer output sequences than input sequences are skipped: they don't contribute to the loss term and have zero-gradient.
name A name for the operation (optional).
Returns
A tuple of Tensor objects (loss, gradient).
loss A Tensor of type float32.
gradient A Tensor of type float32.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.

Last updated 2024-04-26 UTC.