tensorflow::ops::SparseSegmentSum

#include <math_ops.h>

คำนวณผลรวมตามส่วนย่อยที่เบาบางของเทนเซอร์

สรุป

โปรดอ่าน หัวข้อเกี่ยวกับการแบ่งกลุ่ม เพื่อดูคำอธิบายเกี่ยวกับกลุ่มต่างๆ

เหมือนกับ SegmentSum แต่ segment_ids สามารถมีลำดับต่ำกว่ามิติแรกของ data ได้ โดยเลือกชุดย่อยของมิติที่ 0 ซึ่งระบุโดย indices

ตัวอย่างเช่น:

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

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • ดัชนี: เทนเซอร์ 1 มิติ มีลำดับชั้นเดียวกับ segment_ids
  • segment_ids: เทนเซอร์ 1 มิติ ค่าต่างๆ ควรเรียงลำดับและสามารถซ้ำกันได้

การส่งคืนสินค้า:

  • Output : มีรูปร่างเหมือนกับข้อมูล ยกเว้นมิติที่ 0 ซึ่งมีขนาด k ซึ่งเป็นจำนวนส่วนย่อย

ตัวสร้างและตัวทำลาย

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

คุณลักษณะสาธารณะ

operation
output

หน้าที่สาธารณะ

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

คุณลักษณะสาธารณะ

การดำเนินการ

Operation operation

เอาต์พุต

::tensorflow::Output output

หน้าที่สาธารณะ

ผลรวมเซกเมนต์แบบเบาบาง

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

โหนด

::tensorflow::Node * node() const 

ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต

 operator::tensorflow::Input() const 

ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต

 operator::tensorflow::Output() const