tensorflow:: אופס:: SegmentMean

#include <math_ops.h>

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

סיכום

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

מחשב טנזור כך ש- \(output_i = { data_j}{N}\) כאשר mean הוא מעל j כך ש- segment_ids[j] == i ו- N הוא המספר הכולל של הערכים המסוכמים.

אם הממוצע ריק עבור מזהה מקטע נתון i , output[i] = 0 .

לדוגמה:

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

טיעונים:

  • scope: אובייקט Scope
  • segment_ids: טנזור 1-D שגודלו שווה לגודל הממד הראשון של data . יש למיין את הערכים וניתן לחזור עליהם.

החזרות:

  • Output : בעל צורה זהה לנתונים, למעט ממד 0 שיש לו גודל k , מספר המקטעים.

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

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

תכונות ציבוריות

operation
output

תפקידים ציבוריים

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

תכונות ציבוריות

מבצע

Operation operation

תְפוּקָה

::tensorflow::Output output

תפקידים ציבוריים

SegmentMean

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

צוֹמֶת

::tensorflow::Node * node() const 

מפעיל::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const