tensorflow :: ops :: SparseSegmentSum

#include <math_ops.h>

Menghitung jumlah di sepanjang segmen renggang sebuah tensor.

Ringkasan

Baca bagian tentang segmentasi untuk penjelasan tentang segmen.

Seperti SegmentSum , tetapi segment_ids dapat memiliki peringkat kurang dari dimensi pertama data , memilih subkumpulan dimensi 0, yang ditentukan oleh indices .

Sebagai contoh:

c = tf.constant([[1,2,3,4], [-1,-2,-3,-4], [5,6,7,8]])

# Select two rows, one segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 0]))
# => [[0 0 0 0]]

# Select two rows, two segment.
tf.sparse_segment_sum(c, tf.constant([0, 1]), tf.constant([0, 1]))
# => [[ 1  2  3  4]
#     [-1 -2 -3 -4]]

# Select all rows, two segments.
tf.sparse_segment_sum(c, tf.constant([0, 1, 2]), tf.constant([0, 0, 1]))
# => [[0 0 0 0]
#     [5 6 7 8]]

# Which is equivalent to:
tf.segment_sum(c, tf.constant([0, 0, 1]))

Argumen:

  • scope: Objek Scope
  • indeks: Tensor 1-D. Memiliki peringkat yang sama dengan segment_ids .
  • segment_id: Tensor 1-D. Nilai harus diurutkan dan dapat diulang.

Pengembalian:

  • Output : Bentuknya sama dengan data, kecuali dimensi 0 yang ukurannya k , jumlah segmennya.

Pembuat dan Penghancur

SparseSegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input indices, :: tensorflow::Input segment_ids)

Atribut publik

operation
output

Fungsi publik

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Atribut publik

operasi

Operation operation

keluaran

::tensorflow::Output output

Fungsi publik

SparseSegmentSum

 SparseSegmentSum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input data,
  ::tensorflow::Input indices,
  ::tensorflow::Input segment_ids
)

simpul

::tensorflow::Node * node() const 

operator :: tensorflow :: Input

 operator::tensorflow::Input() const 

operator :: tensorflow :: Keluaran

 operator::tensorflow::Output() const