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次元テンソル。保持するサブ対角線の数。負の値の場合は、下三角全体を保持します。
- num_upper: 0次元テンソル。保持するスーパーダイアゴナルの数。負の値の場合は、上三角全体を保持します。
返品:
-
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
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const