tensorflow::ops::MatrixBandPart
#include <array_ops.h>Her bir içteki matriste merkezi bir bant dışındaki her şeyi sıfıra ayarlayan bir tensör kopyalayın.
Özet
band kısmı şu şekilde hesaplanır: input k boyutlu [I, J, K, ..., M, N] olduğunu varsayalım, o zaman çıktı aynı şekle sahip bir tensördür, burada
band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n] .
Gösterge fonksiyonu
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]]Faydalı ö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ş:
kdereceli tensör. - num_lower: 0 boyutlu tensör. Korunacak alt köşegen sayısı. Negatifse, alt üçgenin tamamını koruyun.
- num_upper: 0 boyutlu tensör. Korunacak üst köşegen sayısı. Negatifse, üst üçgenin tamamını koruyun.
İadeler:
-
Output: Girişle aynı şekle sahipkdereceli 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
bant
::tensorflow::Output band
operasyon
Operation operation
Kamusal işlevler
MatrisBantParçası
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