tensorflow :: ops :: MatrixBandPart

#include <array_ops.h>

Copie um tensor configurando tudo fora de uma banda central em cada matriz interna.

Resumo

a zero.

A parte da band é calculada da seguinte forma: Suponha que a input tenha k dimensões [I, J, K, ..., M, N] , então a saída é um tensor com a mesma forma onde

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

A função do indicador

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

Por exemplo:

# 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 especiais úteis:

 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:

  • escopo: um objeto Scope
  • entrada: tensor Rank k .
  • num_lower: tensor 0-D. Número de subdiagonais a serem mantidos. Se negativo, mantenha o triângulo inferior inteiro.
  • num_upper: tensor 0-D. Número de superdiagonais a serem mantidos. Se negativo, mantenha o triângulo superior inteiro.

Retorna:

  • Output : tensor Rank k da mesma forma que a entrada. O tensor em faixas extraído.

Construtores e Destruidores

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

Atributos públicos

band
operation

Funções públicas

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

Atributos públicos

banda

::tensorflow::Output band

Operação

Operation operation

Funções públicas

MatrixBandPart

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

::tensorflow::Node * node() const 

operador :: tensorflow :: Input

 operator::tensorflow::Input() const 

operador :: tensorflow :: Saída

 operator::tensorflow::Output() const