tensorflow::ops::SparseCross
#include <sparse_ops.h>
Генерирует разреженное произведение крест-накрест из списка разреженных и плотных тензоров.
Summary
Операция принимает два списка: один из 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")))
Аргументы:
- scope: Объект Scope
- indices: 2-мерный. Индексы каждого входного
SparseTensor. - values: 1-мерный. Значения каждого
SparseTensor. - shapes: 1-мерный. Формы каждого
SparseTensor. - dense_inputs: 2-мерный. Столбцы, представленные плотными
Tensor. - hashed_output: Если true, возвращает хеш произведения крест-накрест вместо строки. Это позволит избежать манипуляций со строками.
- num_buckets: Используется, если hashed_output равно true. output = hashed_valuenum_buckets, если num_buckets > 0, иначе hashed_value.
- hash_key: Указывает hash_key, который будет использоваться функцией
FingerprintCat64для объединения отпечатков произведений крест-накрест.
Возвращает:
-
Outputoutput_indices: 2-мерный. Индексы объединенныхSparseTensor. -
Outputoutput_values: 1-мерный. Непустые значения объединенного или хешированногоSparseTensor. -
Outputoutput_shape: 1-мерный. Форма объединенногоSparseTensor.
| Конструкторы и деструкторы | |
|---|---|
SparseCross(const ::tensorflow::Scope & scope, ::tensorflow::InputList indices, ::tensorflow::InputList values, ::tensorflow::InputList shapes, ::tensorflow::InputList dense_inputs, bool hashed_output, int64 num_buckets, int64 hash_key, DataType out_type, DataType internal_type) |
| Общедоступные атрибуты | |
|---|---|
operation | |
output_indices | |
output_shape | |
output_values | |
Общедоступные атрибуты
operation
Operation operation
output_indices
::tensorflow::Output output_indices
output_shape
::tensorflow::Output output_shape
output_values
::tensorflow::Output output_values
Общедоступные функции
SparseCross
SparseCross( const ::tensorflow::Scope & scope, ::tensorflow::InputList indices, ::tensorflow::InputList values, ::tensorflow::InputList shapes, ::tensorflow::InputList dense_inputs, bool hashed_output, int64 num_buckets, int64 hash_key, DataType out_type, DataType internal_type )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r1.15/api_docs/cc/class/tensorflow/ops/sparse-cross