tf.nn.ctc_unique_labels
Stay organized with collections
Save and categorize content based on your preferences.
Get unique labels and indices for batched labels for tf.nn.ctc_loss
.
tf.nn.ctc_unique_labels(
labels, name=None
)
For use with tf.nn.ctc_loss
optional argument unique
: This op can be
used to preprocess labels in input pipeline to for better speed/memory use
computing the ctc loss on TPU.
Example:
ctc_unique_labels([[3, 4, 4, 3]]) ->
unique labels padded with 0: [[3, 4, 0, 0]]
indices of original labels in unique: [0, 1, 1, 0]
Args |
labels
|
tensor of shape [batch_size, max_label_length] padded with 0.
|
name
|
A name for this Op . Defaults to "ctc_unique_labels".
|
Returns |
tuple of
- unique labels, tensor of shape
[batch_size, max_label_length]
- indices into unique labels, shape
[batch_size, max_label_length]
|
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.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.nn.ctc_unique_labels\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/nn/ctc_unique_labels) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.1.0/tensorflow/python/ops/ctc_ops.py#L910-L942) |\n\nGet unique labels and indices for batched labels for [`tf.nn.ctc_loss`](../../tf/nn/ctc_loss).\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_unique_labels`](/api_docs/python/tf/nn/ctc_unique_labels)\n\n\u003cbr /\u003e\n\n tf.nn.ctc_unique_labels(\n labels, name=None\n )\n\nFor use with [`tf.nn.ctc_loss`](../../tf/nn/ctc_loss) optional argument `unique`: This op can be\nused to preprocess labels in input pipeline to for better speed/memory use\ncomputing the ctc loss on TPU.\n\n#### Example:\n\nctc_unique_labels(\\[\\[3, 4, 4, 3\\]\\]) -\\\u003e\nunique labels padded with 0: \\[\\[3, 4, 0, 0\\]\\]\nindices of original labels in unique: \\[0, 1, 1, 0\\]\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|----------|-----------------------------------------------------------------|\n| `labels` | tensor of shape \\[batch_size, max_label_length\\] padded with 0. |\n| `name` | A name for this `Op`. Defaults to \"ctc_unique_labels\". |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| tuple of \u003cbr /\u003e - unique labels, tensor of shape `[batch_size, max_label_length]` - indices into unique labels, shape `[batch_size, max_label_length]` ||\n\n\u003cbr /\u003e"]]