przepływ tensorowy:: ops:: Część MatrixBand

#include <array_ops.h>

Skopiuj tensor, ustawiając wszystko poza centralnym pasmem w każdej najbardziej wewnętrznej macierzy.

Streszczenie

do zera.

Część band oblicza się w następujący sposób: Załóżmy, że input mają k wymiarów [I, J, K, ..., M, N] , wówczas wynikiem jest tensor o tym samym kształcie, gdzie

band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j, k, ..., m, n] .

Funkcja wskaźnika

in_band(m, n) = (num_lower < 0 || (mn) <= num_lower)) && (num_upper < 0 || (nm) <= num_upper) .

Na przykład:

# 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]]

Przydatne przypadki specjalne:

 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.

Argumenty:

  • zakres: Obiekt Scope
  • dane wejściowe: tensor rangi k .
  • num_lower: tensor 0-D. Liczba podprzekątnych do zachowania. Jeżeli wynik jest ujemny, zachowaj cały dolny trójkąt.
  • num_upper: tensor 0-D. Liczba superprzekątnych do zachowania. Jeśli wynik jest ujemny, zachowaj cały górny trójkąt.

Zwroty:

  • Output : Tensor rangi k o tym samym kształcie co dane wejściowe. Wyodrębniony tensor pasmowy.

Konstruktory i destruktory

MatrixBandPart (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input num_lower, :: tensorflow::Input num_upper)

Atrybuty publiczne

band
operation

Funkcje publiczne

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Atrybuty publiczne

zespół

::tensorflow::Output band

operacja

Operation operation

Funkcje publiczne

Część MatrixBand

 MatrixBandPart(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input input,
  ::tensorflow::Input num_lower,
  ::tensorflow::Input num_upper
)

węzeł

::tensorflow::Node * node() const 

operator::tensorflow::Wejście

 operator::tensorflow::Input() const 

operator::tensorflow::Wyjście

 operator::tensorflow::Output() const