flux tensoriel : : opérations : : MatrixBandPart

#include <array_ops.h>

Copiez un tenseur définissant tout ce qui se trouve en dehors d'une bande centrale dans chaque matrice la plus interne.

Résumé

à zéro.

La partie band est calculée comme suit : Supposons que input ait k dimensions [I, J, K, ..., M, N] , alors la sortie est un tenseur de même forme où

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

La fonction indicateur

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

Par exemple:

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

Cas particuliers utiles :

 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.

Arguments:

  • scope : un objet Scope
  • entrée : Tenseur de rang k .
  • num_lower : tenseur 0-D. Nombre de sous-diagonales à conserver. Si négatif, conservez tout le triangle inférieur.
  • num_upper : tenseur 0-D. Nombre de superdiagonales à conserver. Si négatif, conservez tout le triangle supérieur.

Retour:

  • Output : Tenseur de rang k de la même forme que l'entrée. Le tenseur bandes extrait.

Constructeurs et Destructeurs

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

Attributs publics

band
operation

Fonctions publiques

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

Attributs publics

groupe

::tensorflow::Output band

opération

Operation operation

Fonctions publiques

MatrixBandPart

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

nœud

::tensorflow::Node * node() const 

opérateur :: tensorflow :: Entrée

 operator::tensorflow::Input() const 

opérateur :: tensorflow :: Sortie

 operator::tensorflow::Output() const