tensorflow:: ops:: 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.

טיעונים:

  • היקף: אובייקט היקף
  • קלט: טנזור דרגה k .
  • 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(
  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