tensor akışı:: işlem:: MatrixBandPart
#include <array_ops.h>Her en içteki matriste merkezi bant dışındaki her şeyi ayarlayan bir tensör kopyalayın.
Özet
sıfıra.
band kısmı şu şekilde hesaplanır: input k boyuta sahip olduğunu varsayarsak [I, J, K, ..., M, N] , bu durumda çıkış aynı şekle sahip bir tensör olur;
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 Kapsam nesnesi
- giriş: Rank
ktensör. - num_lower: 0-D tensörü. Tutulacak alt köşegenlerin sayısı. Negatifse alt üçgenin tamamını koruyun.
- num_upper: 0-D tensörü. Tutulacak süper köşegenlerin sayısı. Negatifse üst üçgenin tamamını koruyun.
İade:
-
Output: Girişle aynı şekle sahip sıraktensö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 | |
Kamu işlevleri | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
Genel özellikler
bant
::tensorflow::Output band
operasyon
Operation operation
Kamu işlevleri
MatrixBandPart
MatrixBandPart( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input num_lower, ::tensorflow::Input num_upper )
düğüm
::tensorflow::Node * node() const
operatör::tensorflow::Giriş
operator::tensorflow::Input() const
operatör::tensorflow::Çıktı
operator::tensorflow::Output() const