テンソルフロー::作戦::マトリックスダイアグ

#include <array_ops.h>

指定されたバッチ対角値を持つバッチ対角テンソルを返します。

まとめ

diagonalを指定すると、この演算はdiagonalとその他すべてにゼロが埋め込まれたテンソルを返します。対角線は次のように計算されます。

diagonal k次元[I, J, K, ..., N]であると仮定すると、出力は次元 [I, J, K, ..., N, N]` を持つランクk+1のテンソルになります。

output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]

例えば:

# 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]]

and diagonal.shape = (2, 4)

tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0]
                                     [0, 2, 0, 0]
                                     [0, 0, 3, 0]
                                     [0, 0, 0, 4]],
                                    [[5, 0, 0, 0]
                                     [0, 6, 0, 0]
                                     [0, 0, 7, 0]
                                     [0, 0, 0, 8]]]

which has shape (2, 4, 4)

引数:

  • スコープ:スコープオブジェクト
  • 対角線: ランクk 、ここでk >= 1

戻り値:

  • Output : ランクk+1output.shape = diagonal.shape + [diagonal.shape[-1]]

コンストラクターとデストラクター

MatrixDiag (const :: tensorflow::Scope & scope, :: tensorflow::Input diagonal)

パブリック属性

operation
output

公共機能

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

パブリック属性

手術

Operation operation

出力

::tensorflow::Output output

公共機能

マトリックスダイアグ

 MatrixDiag(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input diagonal
)

ノード

::tensorflow::Node * node() const 

演算子::tensorflow::入力

 operator::tensorflow::Input() const 

演算子::tensorflow::出力

 operator::tensorflow::Output() const