codecamp

如何将TensorFlow输入特征解析为张量

函数:tf.FixedLenSequenceFeature

FixedLenSequenceFeature 类

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

参阅指南:输入和读取器>协议缓冲区

用于将可变长度输入特征解析为张量的配置.
所产生的分析单个 SequenceExample 或 Example 的张量具有 [None] + shape 和 指定 dtype 的静态形状.所得到的解析 batch_size 的许多 Example S 的张量有一个静态形状的 [batch_size, None] + shape 和指定的 dtype.不同示例(Examples)的批处理中的条目将用 default_value 填充到批处理中存在的最大长度.

将稀疏输入处理为稠密,提供 allow_missing = True;否则,分析函数将在任何缺少此功能的示例上失败.

函数字段:

  • shape:维度为 2 及以上的输入数据形状.第一维度是可变长度 None.
  • dtype:输入的数据类型.
  • allow_missing:是否允许从功能列表项中丢失此功能.仅适用于解析 SequenceExample,而不用于解析 Examples.
  • default_value:用于将多个 Example 填充到其最大长度的标量值.与解析单个 Example 或 SequenceExample 无关.默认为 dtype 字符串,否则为0(可选).

属性

  • allow_missing
    字段2的别名
  • default_value
    字段3的别名
  • dtype
    字段1的别名
  • shape
    字段号0的别名

方法

__new__

__new__(
    cls,
    shape,
    dtype,
    allow_missing=False,
    default_value=None
)
TensorFlow从文件中输出记录的读取器
如何使用TensorFlow的floor函数
温馨提示
下载编程狮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; }