fluxo tensor:: ops:: Cruz esparsa

#include <sparse_ops.h>

Gera cruzamentos esparsos a partir de uma lista de tensores esparsos e densos.

Resumo

A operação leva duas listas, uma de 2D SparseTensor e outra de 2D Tensor , cada uma representando recursos de uma coluna de recursos. Ele gera um SparseTensor 2D com os cruzamentos em lote desses recursos.

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 então 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 Escopo
  • índices: 2-D. Índices de cada entrada SparseTensor .
  • valores: 1-D. valores de cada SparseTensor .
  • formas: 1-D. Formas de cada SparseTensor .
  • entradas_densas: 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. saída = hashed_valuenum_buckets se num_buckets > 0 senão hashed_value.
  • hash_key: Especifique o hash_key que será usado pela função FingerprintCat64 para combinar as impressões digitais cruzadas.

Retorna:

  • Output output_indices: 2-D. Índices do SparseTensor concatenado.
  • Valores_de_saída Output : 1-D. Valores não vazios do SparseTensor concatenado ou com hash.
  • Output output_shape: 1-D. Forma do SparseTensor concatenado.

Construtores e Destruidores

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

forma_saída

::tensorflow::Output output_shape

valores_saída

::tensorflow::Output output_values

Funções públicas

Cruz esparsa

 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
)