tensorflow::ops::SparseCross

#include <sparse_ops.h>

Gera uma matriz cruzada esparsa a partir de uma lista de tensores esparsos e densos.

Resumo

A operação recebe duas listas, uma de tensores esparsos bidimensionais (2D SparseTensor e outra de tensores bidimensionais (2D Tensor , cada uma representando características de uma coluna de características. Ela retorna um tensor esparso bidimensional (2D SparseTensor com os cruzamentos em lote dessas características.

Por exemplo, se as entradas forem

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"]]

então a saída será

shape = [2, 2]
[0, 0]: "a_X_d_X_f"
[1, 0]: "b_X_e_X_g"
[1, 1]: "c_X_e_X_g"

Se `hashed_output=true`, a saída será

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")))

Argumentos:

  • escopo: Um objeto de escopo
  • índices: 2-D. Índices de cada SparseTensor de entrada.
  • valores: 1-D. valores de cada SparseTensor .
  • Formas: 1-D. Formas de cada SparseTensor .
  • dense_inputs: 2-D. Colunas representadas por Tensor denso.
  • `hashed_output`: Se verdadeiro, retorna o hash da cruz em vez da string. Isso nos permitirá evitar manipulações de strings.
  • num_buckets: É usado se hashed_output for verdadeiro. output = hashed_valuenum_buckets se num_buckets > 0 senão hashed_value.
  • hash_key: Especifique a chave hash que será usada pela função FingerprintCat64 para combinar as impressões digitais cruzadas.

Devoluções:

  • Output output_indices: 2-D. Índices do SparseTensor concatenado.
  • Output output_values: 1-D. Valores não vazios do SparseTensor concatenado ou hashed.
  • Output output_shape: 1-D. Formato do SparseTensor concatenado.

Construtores e Destrutores

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)

Atributos públicos

operation
output_indices
output_shape
output_values

Atributos públicos

operação

Operation operation

índices_de_saída

::tensorflow::Output output_indices

formato_de_saída

::tensorflow::Output output_shape

valores_de_saída

::tensorflow::Output output_values

Funções públicas

Cruzamento esparso

 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
)