TensorFlow函数教程:tf.keras.backend.ctc_decode

2019-03-10 13:20 更新

tf.keras.backend.ctc_decode函数

tf.keras.backend.ctc_decode(
    y_pred,
    input_length,
    greedy=True,
    beam_width=100,
    top_paths=1
)

定义在:tensorflow/python/keras/backend.py。

解码softmax的输出。

可以使用贪婪搜索(也称为最佳路径)或约束字典搜索。

参数:

  • y_pred:张量(samples, time_steps, num_categories) 包含预测值,或softmax的输出。
  • input_length:张量(samples, )包含y_pred中每个批处理项的序列长度。
  • greedy:如果为true,执行更快的最佳路径搜索    。这不使用字典。
  • beam_width:如果greedy为false:将使用该宽度的 beam 搜索解码器搜索。
  • top_paths:如果greedy为false,将返回多少最可能的路径。

返回:

  • Tuple:
  • List:如果greedy为true,则返回包含已解码序列的一个元素的列表。如果为false,则返回top_paths最可能的解码序列。
  • Important:空白标签返回为-1。张量(top_paths, )包含每个解码序列的对数概率。
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号