テンソルフロー::作戦::スパースクロス

#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出力値: 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
output_indices
output_shape
output_values

パブリック属性

手術

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
)