当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


Python tf.raw_ops.ParseSequenceExampleV2用法及代码示例


将 tf.io.SequenceExample 原型的向量(作为字符串)转换为

用法

tf.raw_ops.ParseSequenceExampleV2(
    serialized, debug_name, context_sparse_keys, context_dense_keys,
    context_ragged_keys, feature_list_sparse_keys, feature_list_dense_keys,
    feature_list_ragged_keys, feature_list_dense_missing_assumed_empty,
    context_dense_defaults, Ncontext_sparse=0, context_sparse_types=[],
    context_ragged_value_types=[], context_ragged_split_types=[],
    context_dense_shapes=[], Nfeature_list_sparse=0, Nfeature_list_dense=0,
    feature_list_dense_types=[], feature_list_sparse_types=[],
    feature_list_ragged_value_types=[], feature_list_ragged_split_types=[],
    feature_list_dense_shapes=[], name=None
)

类型的张量。

Args:序列化:ATensor类型string.包含二进制序列化 SequenceExample 原型的标量或向量。 debug_name:ATensor类型string.包含序列化原型名称的标量或向量。例如,可能包含相应序列化原型的表键(说明性)名称。这纯粹用于调试目的,此处的值对输出没有影响。如果没有可用的名称,也可能是一个空向量。 context_sparse_keys:ATensor类型string.与context_sparse 值关联的示例函数中预期的键。 context_dense_keys:ATensor类型string. SequenceExamples 的上下文特征中预期的键与密集值相关联。 context_ragged_keys:ATensor类型string.与context_ragged 值关联的示例函数中预期的键。 feature_list_sparse_keys:ATensor类型string. FeatureLists 中预期的与稀疏值关联的键。 feature_list_dense_keys:ATensor类型string. SequenceExamples 的feature_lists 中预期的键与密集值列表相关联。 feature_list_ragged_keys:ATensor类型string. FeatureLists 中预期的与不规则值关联的键。 feature_list_dense_missing_assumed_empty:ATensor类型bool.与feature_list_dense_keys 1:1 对应的向量,指示序列示例中可能缺少哪些特征。如果缺少关联的 FeatureList,则将其视为空。 context_dense_defaults:列表Tensor对象类型来自:float32,int64,string. Ncontext_dense 张量列表(有些可能为空)。当 SequenceExample 的上下文映射缺少 context_dense_key[j] 时,context_dense_defaults[j] 提供默认值。如果为context_dense_defaults[j] 提供了一个空的张量,则需要特征context_dense_keys[j]。输入类型是从 context_dense_defaults[j] 推断出来的,即使它是空的。如果context_dense_defaults[j] 不为空,则其形状必须与context_dense_shapes[j] 匹配。 Ncontext_sparse:可选int那是>= 0.默认为0. context_sparse_types:可选列表tf.DTypes从:tf.float32, tf.int64, tf.string.默认为[]. Ncontext_sparse 类型列表; context_sparse_keys中给出的每个上下文特征中数据的数据类型。目前 ParseSingleSequenceExample 支持 DT_FLOAT (FloatList)、DT_INT64 (Int64List) 和 DT_STRING (BytesList)。 context_ragged_value_types:可选列表tf.DTypes从:tf.float32, tf.int64, tf.string.默认为[].参差不齐的上下文特征的 RaggedTensor.value dtypes。 context_ragged_split_types:可选列表tf.DTypes从:tf.int32, tf.int64.默认为[]. RaggedTensor.row_split dtypes 用于参差不齐的上下文特征。 context_dense_shapes:可选的形状列表(每个tf.TensorShape或清单ints)。默认为[]. Ncontext_dense 形状列表; context_dense_keys 中给出的每个上下文特征中的数据形状。 Feature 中对应于context_dense_key[j] 的元素数量必须始终等于context_dense_shapes[j].NumEntries()。 context_dense_values[j] 的形状将匹配 context_dense_shapes[j]。 Nfeature_list_sparse:可选int那是>= 0.默认为0. Nfeature_list_dense:可选int那是>= 0.默认为0. feature_list_dense_types:可选列表tf.DTypes从:tf.float32, tf.int64, tf.string.默认为[]. feature_list_sparse_types:可选列表tf.DTypes从:tf.float32, tf.int64, tf.string.默认为[]. Nfeature_list_sparse 类型列表; feature_list_sparse_keys 中给出的每个 FeatureList 中数据的数据类型。目前 ParseSingleSequenceExample 支持 DT_FLOAT (FloatList)、DT_INT64 (Int64List) 和 DT_STRING (BytesList)。 feature_list_ragged_value_types:可选列表tf.DTypes从:tf.float32, tf.int64, tf.string.默认为[].参差不齐的 FeatureList 函数的 RaggedTensor.value dtypes。 feature_list_ragged_split_types:可选列表tf.DTypes从:tf.int32, tf.int64.默认为[]. RaggedTensor.row_split dtypes 用于参差不齐的 FeatureList 函数。 feature_list_dense_shapes:可选的形状列表(每个tf.TensorShape或清单ints)。默认为[]. Nfeature_list_dense 形状列表; feature_list_dense_keys 中给出的每个 FeatureList 中的数据形状。 FeatureList 中与feature_list_dense_key[j] 对应的每个Feature 的形状必须始终等于feature_list_dense_shapes[j].NumEntries()。 name:操作的名称(可选)。

返回:一个元组Tensor对象(context_sparse_indices, context_sparse_values, context_sparse_shapes, context_dense_values, context_ragged_values, context_ragged_row_splits, feature_list_sparse_indices, feature_list_sparse_values, feature_list_sparse_shapes, feature_list_dense_values, feature_list_dense_lengths, feature_list_ragged_values, feature_list_ragged_outer_splits, feature_list_ragged_inner_splits).

context_sparse_indices:A list of `Ncontext_sparse` `Tensor` objects with type `int64`.
context_sparse_values:A list of `Tensor` objects of type `context_sparse_types`.
context_sparse_shapes:A list of `Ncontext_sparse` `Tensor` objects with type `int64`.
context_dense_values:A list of `Tensor` objects. Has the same type as `context_dense_defaults`.
context_ragged_values:A list of `Tensor` objects of type `context_ragged_value_types`.
context_ragged_row_splits:A list of `Tensor` objects of type `context_ragged_split_types`.
feature_list_sparse_indices:A list of `Nfeature_list_sparse` `Tensor` objects with type `int64`.
feature_list_sparse_values:A list of `Tensor` objects of type `feature_list_sparse_types`.
feature_list_sparse_shapes:A list of `Nfeature_list_sparse` `Tensor` objects with type `int64`.
feature_list_dense_values:A list of `Tensor` objects of type `feature_list_dense_types`.
feature_list_dense_lengths:A list of `Nfeature_list_dense` `Tensor` objects with type `int64`.
feature_list_ragged_values:A list of `Tensor` objects of type `feature_list_ragged_value_types`.
feature_list_ragged_outer_splits:A list of `Tensor` objects of type `feature_list_ragged_split_types`.
feature_list_ragged_inner_splits:A list of `Tensor` objects of type `feature_list_ragged_split_types`.

相关用法


注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.raw_ops.ParseSequenceExampleV2。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。