从稀疏和密集张量列表生成稀疏交叉。
用法
tf.raw_ops.SparseCrossV2(
indices, values, shapes, dense_inputs, sep, name=None
)参数
-
indices类型为int64的Tensor对象列表。二维。每个输入的索引SparseTensor。 -
valuesTensor对象列表,其类型来自:int64,string。一维。每个SparseTensor的值。 -
shapes与类型为int64的Tensor对象的indices长度相同的列表。一维。每个SparseTensor的形状。 -
dense_inputsTensor对象列表,其类型来自:int64,string。二维。由密集Tensor表示的列。 -
sepTensor类型为string。加入字符串输入列表时使用的字符串,以后可以用作分隔符。 -
name操作的名称(可选)。
返回
-
Tensor对象的元组(output_indices、output_values、output_shape)。 -
output_indicesTensor类型为int64。 -
output_valuesTensor类型为string。 -
output_shapeTensor类型为int64。
该操作采用两个列表,一个是 2D SparseTensor ,另一个是 2D Tensor ,每个列表代表一个特征列的特征。它输出具有这些特征的批量交叉的 2D SparseTensor。
例如,如果输入是
inputs[0]:SparseTensor with shape = [2, 2]
[0, 0]:"a"
[1, 0]:"b"
[1, 1]:"c"
inputs[1]:SparseTensor with shape = [2, 1]
[0, 0]:"d"
[1, 0]:"e"
inputs[2]:Tensor [["f"], ["g"]]
那么输出将是
shape = [2, 2]
[0, 0]:"a_X_d_X_f"
[1, 0]:"b_X_e_X_g"
[1, 1]:"c_X_e_X_g"
如果 hashed_output=true 那么输出将是
shape = [2, 2]
[0, 0]:FingerprintCat64(
Fingerprint64("f"), FingerprintCat64(
Fingerprint64("d"), Fingerprint64("a")))
[1, 0]:FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("b")))
[1, 1]:FingerprintCat64(
Fingerprint64("g"), FingerprintCat64(
Fingerprint64("e"), Fingerprint64("c")))
相关用法
- Python tf.raw_ops.SparseCross用法及代码示例
- Python tf.raw_ops.SparseCrossHashed用法及代码示例
- Python tf.raw_ops.SparseConcat用法及代码示例
- Python tf.raw_ops.SparseSegmentSumWithNumSegments用法及代码示例
- Python tf.raw_ops.SparseMatrixSparseMatMul用法及代码示例
- Python tf.raw_ops.SparseMatrixOrderingAMD用法及代码示例
- Python tf.raw_ops.SparseFillEmptyRows用法及代码示例
- Python tf.raw_ops.SparseSlice用法及代码示例
- Python tf.raw_ops.SparseToDense用法及代码示例
- Python tf.raw_ops.SparseSplit用法及代码示例
- Python tf.raw_ops.SparseMatrixSparseCholesky用法及代码示例
- Python tf.raw_ops.SparseSegmentSum用法及代码示例
- Python tf.raw_ops.SparseMatrixMatMul用法及代码示例
- Python tf.raw_ops.SpaceToDepth用法及代码示例
- Python tf.raw_ops.SpaceToBatch用法及代码示例
- Python tf.raw_ops.SpaceToBatchND用法及代码示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代码示例
- Python tf.raw_ops.Size用法及代码示例
- Python tf.raw_ops.ScatterUpdate用法及代码示例
- Python tf.raw_ops.ScatterNdUpdate用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.raw_ops.SparseCrossV2。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
