tensorflow:: ops:: SparseSoftmax

#include <sparse_ops.h>

バッチ化された ND SparseTensorにソフトマックスを適用します。

まとめ

入力は、論理形状[..., B, C] ( N >= 2 )を持つNDスパーステンソルを表し、インデックスは標準的な辞書式順序でソートされています。

この操作は、形状が[B, C]の各最内側の論理部分行列に通常のtf.nn.softmax()適用することと同等ですが、暗黙的にゼロとなる要素は適用されないという点が異なります。具体的には、このアルゴリズムは以下と同等です。

(1) サイズ C 次元に沿って、形状[B, C]の各最内部分行列の密化されたビューにtf.nn.softmax()を適用します。(2) 元の暗黙的にゼロの位置をマスクします。(3) 残りの要素を再正規化します。

したがって、 SparseTensor結果は、まったく同じ非ゼロのインデックスと形状を持ちます。

議論:

  • スコープ:スコープオブジェクト
  • sp_indices: 2次元。スパーステンソル内の空でない値のインデックスを正規順序で格納したNNZ x R行列。
  • sp_indices : 1次元。sp_indicesに対応するNNZ非空値。
  • sp_shape: 1次元。入力SparseTensorの形状。

返品:

  • Output :1次元。結果SparseTensorのNNZ値。

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

SparseSoftmax (const :: tensorflow::Scope & scope, :: tensorflow::Input sp_indices, :: tensorflow::Input sp_values, :: tensorflow::Input sp_shape)

公開属性

operation
output

公的機能

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

公開属性

手術

Operation operation

出力

::tensorflow::Output output

公的機能

SparseSoftmax

 SparseSoftmax(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input sp_indices,
  ::tensorflow::Input sp_values,
  ::tensorflow::Input sp_shape
)

ノード

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const