tensorflow :: ops :: SparseSoftmax
#include <sparse_ops.h>
バッチ処理されたSparseTensor
を適用します。
概要
入力は、論理形状[..., B, C]
( N >= 2
)、および正規の辞書式順序でソートされたインデックスを持つNDSparseTensorを表します。
この操作は、通常のtf.nn.softmax()
を形状[B, C]
最も内側の各論理部分行列に適用するのと同じですが、暗黙的にゼロの要素が関与しないというキャッチがあります。具体的には、アルゴリズムは次のものと同等です。
(1) tf.nn.softmax()
を、サイズCの次元に沿った形状[B, C]
の各最も内側の部分行列の高密度化されたビューに適用します。 (2)元の暗黙的にゼロの場所をマスクします。 (3)残りの要素を再正規化します。
したがって、 SparseTensor
結果は、ゼロ以外のインデックスと形状がまったく同じになります。
引数:
- スコープ:スコープオブジェクト
- sp_indices:2-D。
NNZ x R
空でない値のインデックスを正規の順序で使用したNNZxR行列。 - sp_values:1-D。
NNZ
対応するsp_indices
空でない値。 - sp_shape:1-D。入力SparseTensorの形状。
戻り値:
-
Output
:1-D。結果の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