tensorflow:: אופס:: SparseSoftmax

#include <sparse_ops.h>

מחיל softmax על ND SparseTensor אצווה.

סיכום

התשומות מייצגות ND SparseTensor עם צורה לוגית [..., B, C] (כאשר N >= 2 ), ועם אינדקסים ממוינים בסדר הלקסיקוגרפי הקנוני.

אופציה זו מקבילה להחלת ה- tf.nn.softmax() הרגיל על כל תת-מטריצה ​​לוגית פנימית עם צורה [B, C] , אך עם התפס שהאלמנטים האפסים המשתמעים אינם משתתפים . באופן ספציפי, האלגוריתם שווה ערך לדברים הבאים:

(1) מחיל tf.nn.softmax() על תצוגה צפופה של כל תת-מטריצה ​​הפנימית ביותר עם צורה [B, C] , לאורך ממד גודל-C; (2) מסווה את המיקומים המקוריים במרומז-אפס; (3) מנרמל מחדש את האלמנטים הנותרים.

לפיכך, לתוצאה של SparseTensor יש בדיוק אותם מדדים וצורה שאינם אפס.

טיעונים:

  • scope: אובייקט Scope
  • sp_indices: 2-D. מטריצת NNZ x R עם המדדים של ערכים לא ריקים ב-SparseTensor, בסדר קנוני.
  • sp_values: 1-D. ערכים לא ריקים NNZ התואמים ל- sp_indices .
  • sp_shape: 1-D. צורת הקלט SparseTensor.

החזרות:

  • Output : 1-D. ערכי NNZ עבור התוצאה SparseTensor .

בנאים והורסים

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 

מפעיל::tensorflow::קלט

 operator::tensorflow::Input() const 

אופרטור::tensorflow::פלט

 operator::tensorflow::Output() const