codecamp

TensorFlow函数教程:tf.nn.ctc_greedy_decoder

tf.nn.ctc_greedy_decoder函数

tf.nn.ctc_greedy_decoder(
    inputs,
    sequence_length,
    merge_repeated=True
)

定义在:tensorflow/python/ops/ctc_ops.py.

参见指南:神经网络>连接时间分类(CTC)

对输入中给出的logit上执行greedy解码.(最佳方法)

注意:无论merge_repeated的值如何,如果给定时间和批处理的最大索引对应于空白索引(num_classes - 1),则不会发出新元素.

如果merge_repeatedTrue,则在输出中合并重复的类.这意味着如果连续logits的最大索引相同,则只发出第一个.序列A B B * B * B(其中'*'是空白标签)将会是:

  • A B B B,如果merge_repeated=True.
  • A B B B B,如果merge_repeated=False.

参数:

  • inputs:3-Dfloat Tensor,大小为[max_time, batch_size, num_classes],是logits.
  • sequence_length:1-Dint32向量,包含序列长度,具有大小[batch_size].
  • merge_repeatedBoolean,默认值:True.

返回:

元组(decoded, log_probabilities),其中已解码:单个元素列表,decoded[0] 是一个包含解码输出的SparseTensor:

decoded.indices: Indices matrix (total_decoded_outputs, 2),行存储:[batch, time].

decoded.values: Values vector, size (total_decoded_outputs),向量存储波束 j 的解码类.

decoded.dense_shape: Shape vector, size (2),形状值为[batch_size, max_decoded_length] 

neg_sum_logits:对于找到的序列,一个浮点矩阵(batch_size x 1)包含每个时间框架中最大 logit 之和的负数
TensorFlow函数教程:tf.nn.ctc_beam_search_decoder
TensorFlow函数教程:tf.nn.ctc_loss
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }