텐서플로우:: ops:: MatrixBandPart

#include <array_ops.h>

각 가장 안쪽 행렬에서 중앙 밴드 바깥쪽의 모든 항목을 설정하는 텐서를 복사합니다.

요약

0으로.

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.

논거:

  • 범위: Scope 객체
  • 입력: 랭크 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() const 

연산자::텐서플로우::출력

 operator::tensorflow::Output() const