テンソルフロー::作戦::スパースクロス
#include <sparse_ops.h>
スパースおよびデンステンソルのリストからスパースクロスを生成します。
まとめ
この操作は 2 つのリスト (2D SparseTensor
の 1 つと 2D Tensor
の 1 つ) を受け取り、それぞれが 1 つの特徴列の特徴を表します。これらの特徴をバッチごとに交差させた 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")))
引数:
- スコープ:スコープオブジェクト
- インデックス: 2-D。各入力
SparseTensor
のインデックス。 - 値: 1-D。各
SparseTensor
の値。 - 形状: 1-D。各
SparseTensor
の形状。 - 密な入力: 2 次元。密な
Tensor
で表される列。 - hashed_output: true の場合、文字列の代わりにクロスのハッシュを返します。これにより、文字列の操作を回避できるようになります。
- num_buckets: hashed_output が true の場合に使用されます。出力 = hashed_valuenum_buckets if num_buckets > 0 else hashed_value。
- hash_key: 指紋を結合するために
FingerprintCat64
関数によって使用される hash_key を指定します。
戻り値:
-
Output
output_indices: 2-D。連結されたSparseTensor
のインデックス。 -
Output
output_values: 1-D。連結またはハッシュされたSparseTensor
の空でない値。 -
Output
出力形状: 1-D。連結された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 operation
出力インデックス
::tensorflow::Output output_indices
出力形状
::tensorflow::Output output_shape
出力値
::tensorflow::Output output_values
公共機能
スパースクロス
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
)