تينسورفلو :: العمليات :: UnsortedSegmentSum

#include <math_ops.h>

يحسب المجموع على طول أجزاء موتر.

ملخص

اقرأ القسم الخاص بالتجزئة للحصول على شرح للقطاعات.

يحسب موترًا مثل \(output[i] = {j...} data[j...]\) حيث يكون المجموع أكبر من الصفوف j... مثل segment_ids[j...] == i . بخلاف SegmentSum ، لا يلزم فرز معرفات segment_ids ولا تحتاج إلى تغطية جميع القيم في النطاق الكامل للقيم الصالحة.

إذا كان المجموع فارغًا لمعرّف مقطع معين i ، يكون output[i] = 0 . إذا كان معرّف المقطع i سالبًا ، يتم إسقاط القيمة ولن تتم إضافته إلى مجموع المقطع.

يجب أن يساوي num_segments عدد معرفات الأجزاء المميزة.

c = tf.constant([[1,2,3,4], [5,6,7,8], [4,3,2,1]])
tf.unsorted_segment_sum(c, tf.constant([0, 1, 0]), num_segments=2)
# ==> [[ 5,  5, 5, 5],
#       [5,  6, 7, 8]]

الحجج:

  • النطاق: كائن النطاق
  • section_ids: موتر شكله هو بادئة من data.shape .

عائدات:

  • Output : له نفس شكل البيانات ، باستثناء num_segments segment_ids.rank

البنائين والمدمرين

UnsortedSegmentSum (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input segment_ids, :: tensorflow::Input num_segments)

السمات العامة

operation
output

الوظائف العامة

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

السمات العامة

عملية

Operation operation

انتاج

::tensorflow::Output output

الوظائف العامة

UnsortedSegmentSum

 UnsortedSegmentSum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input data,
  ::tensorflow::Input segment_ids,
  ::tensorflow::Input num_segments
)

العقدة

::tensorflow::Node * node() const 

المشغل :: tensorflow :: الإدخال

 operator::tensorflow::Input() const 

المشغل :: Tensorflow :: Output

 operator::tensorflow::Output() const