flujo tensor:: operaciones:: Parte de banda de matriz

#include <array_ops.h>

Copie un tensor colocando todo fuera de una banda central en cada matriz más interna.

Resumen

a cero.

La parte band se calcula de la siguiente manera: Supongamos que input tiene k dimensiones [I, J, K, ..., M, N] , entonces la salida es un tensor con la misma forma donde

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

La función indicadora

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

Por ejemplo:

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

Casos especiales útiles:

 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.

Argumentos:

  • alcance: un objeto de alcance
  • entrada: tensor de rango k .
  • num_lower: tensor 0-D. Número de subdiagonales a mantener. Si es negativo, conserve todo el triángulo inferior.
  • num_upper: tensor 0-D. Número de superdiagonales a mantener. Si es negativo, conserve todo el triángulo superior.

Devoluciones:

  • Output : Tensor de rango k de la misma forma que la entrada. El tensor bandeado extraído.

Constructores y destructores

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

Atributos públicos

band
operation

Funciones públicas

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

Atributos públicos

banda

::tensorflow::Output band

operación

Operation operation

Funciones públicas

Parte de banda de matriz

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

nodo

::tensorflow::Node * node() const 

operador::tensorflow::Entrada

 operator::tensorflow::Input() const 

operador::tensorflow::Salida

 operator::tensorflow::Output() const