tensorflow:: אופס:: UnsortedSegmentSum

#include <math_ops.h>

מחשב את הסכום לאורך מקטעים של טנזור.

סיכום

קרא את הקטע על פילוח להסבר על הפלחים.

מחשב טנזור כך ש- \(output[i] = {j...} data[j...]\) שבו הסכום הוא מעל tuples 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]]

טיעונים:

  • scope: אובייקט Scope
  • segment_ids: טנסור שצורתו היא קידומת של data.shape .

החזרות:

  • Output : בעל צורה זהה לנתונים, למעט ממדי segment_ids.rank הראשונים, שמוחלפים במאפיין יחיד בעל גודל num_segments .

בנאים והורסים

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::פלט

 operator::tensorflow::Output() const