tensor akışı:: işlem:: Seyrek Segment Toplamı

#include <math_ops.h>

Bir tensörün seyrek bölümleri boyunca toplamı hesaplar.

Özet

Segmentlerin açıklaması için segmentasyon bölümünü okuyun.

SegmentSum gibi, ancak segment_ids indices tarafından belirtilen 0 boyutunun bir alt kümesini seçerek, data ilk boyutundan daha düşük bir sıralamaya sahip olabilir.

Örneğin:

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

Argümanlar:

  • kapsam: Bir Kapsam nesnesi
  • endeksler: 1 boyutlu bir tensör. segment_ids ile aynı sıralamaya sahiptir.
  • segment_ids: 1 boyutlu bir tensör. Değerler sıralanmalı ve tekrarlanabilir olmalıdır.

İadeler:

  • Output : Segment sayısı olan k boyutuna sahip 0 boyutu dışında verilerle aynı şekle sahiptir.

Yapıcılar ve Yıkıcılar

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

Genel özellikler

operation
output

Kamu işlevleri

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

Genel özellikler

operasyon

Operation operation

çıktı

::tensorflow::Output output

Kamu işlevleri

Seyrek Segment Toplamı

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

düğüm

::tensorflow::Node * node() const 

operatör::tensorflow::Giriş

 operator::tensorflow::Input() const 

operatör::tensorflow::Çıktı

 operator::tensorflow::Output() const