tensorflow:: אופס:: MatrixBandPart

#include <array_ops.h>

העתק טנזור שמגדיר הכל מחוץ לרצועה מרכזית בכל מטריצה ​​הפנימית ביותר.

סיכום

לאפס.

חלק band מחושב באופן הבא: נניח input יש k מידות [I, J, K, ..., M, N] , אז הפלט הוא טנסור עם אותה צורה שבה

band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n] .

פונקציית המחוון

in_band(m, n) = (num_lower < 0 || (mn) <= num_lower)) && (num_upper < 0 || (nm) <= num_upper) .

לדוגמה:

# if 'input' is [[ 0,  1,  2, 3]
                 [-1,  0,  1, 2]
                 [-2, -1,  0, 1]
                 [-3, -2, -1, 0]],

tf.matrix_band_part(input, 1, -1) ==> [[ 0,  1,  2, 3]
                                       [-1,  0,  1, 2]
                                       [ 0, -1,  0, 1]
                                       [ 0,  0, -1, 0]],

tf.matrix_band_part(input, 2, 1) ==> [[ 0,  1,  0, 0]
                                      [-1,  0,  1, 0]
                                      [-2, -1,  0, 1]
                                      [ 0, -2, -1, 0]]

מקרים מיוחדים שימושיים:

 tf.matrix_band_part(input, 0, -1) ==> Upper triangular part.
 tf.matrix_band_part(input, -1, 0) ==> Lower triangular part.
 tf.matrix_band_part(input, 0, 0) ==> Diagonal.

טיעונים:

  • scope: אובייקט Scope
  • קלט: דירוג k tensor.
  • num_lower: טנסור 0-D. מספר תת-אלכסונים שיש לשמור. אם שלילי, שמור את כל המשולש התחתון.
  • num_upper: טנסור 0-D. מספר אלכסוני העל שיש לשמור. אם שלילי, שמור את כל המשולש העליון.

החזרות:

  • Output : דרג k טנסור באותה צורה כמו קלט. הטנזור הרצועות שחולץ.

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

MatrixBandPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input num_lower, :: tensorflow::Input num_upper)

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

band
operation

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

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

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

לְהִתְאַגֵד

::tensorflow::Output band

מבצע

Operation operation

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

MatrixBandPart

 MatrixBandPart(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input num_lower,
  ::tensorflow::Input num_upper
)

צוֹמֶת

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const