tensorflow :: ops :: MatrixBandPart
#include <array_ops.h>
En içteki matristeki bir merkez bandın dışındaki her şeyi bir tensör ayarını kopyalayın.
Özet
sıfıra.
band
kısmı şu şekilde hesaplanır: input
k
boyutuna [I, J, K, ..., M, N]
sahip olduğunu varsayın, o zaman çıktının aynı şekle sahip bir tensör olduğu
band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n]
.
Gösterge işlevi
in_band(m, n) = (num_lower < 0 || (mn) <= num_lower)) && (num_upper < 0 || (nm) <= num_upper)
.
Örneğin:
# 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]]
Yararlı özel durumlar:
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.
Argümanlar:
- kapsam: Bir Scope nesnesi
- girdi: Derece
k
tensörü. - num_lower: 0-D tensör. Saklanacak alt köşegen sayısı. Negatifse, alt üçgenin tamamını koruyun.
- num_upper: 0-D tensör. Saklanacak süper köşegen sayısı. Negatifse, üst üçgenin tamamını koruyun.
İadeler:
-
Output
: Girdi ile aynı şekle sahip sırak
tensörü. Çıkarılan bantlı tensör.
Yapıcılar ve Yıkıcılar | |
---|---|
MatrixBandPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input num_lower, :: tensorflow::Input num_upper) |
Genel özellikler | |
---|---|
band | |
operation |
Kamusal işlevler | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Genel özellikler
grup
::tensorflow::Output band
operasyon
Operation operation
Kamusal işlevler
MatrixBandPart
MatrixBandPart( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input num_lower, ::tensorflow::Input num_upper )
düğüm
::tensorflow::Node * node() const
operator :: tensorflow :: Girdi
operator::tensorflow::Input() const
operator :: tensorflow :: Çıktı
operator::tensorflow::Output() const