tensorflow:: אופס:: LearnedUnigramCandidateSampler

#include <candidate_sampling_ops.h>

יוצר תוויות לדגימת מועמדים עם התפלגות אוניגרמה נלמדת.

סיכום

ראה הסברים על דגימת מועמדים ותבניות הנתונים ב-go/candidate-sampling.

עבור כל אצווה, פעולה זו בוחרת קבוצה אחת של תוויות מועמדות שנדגמו.

היתרונות של דגימת מועמדים לכל אצווה הם הפשטות והאפשרות של כפל מטריקס צפוף יעיל. החיסרון הוא שיש לבחור את המועמדים הנדגמים ללא תלות בהקשר ובתוויות האמיתיות.

טיעונים:

  • scope: אובייקט Scope
  • true_classes: מטריצת batch_size * num_true, שבה כל שורה מכילה את המזהים של num_true target_classes בתווית המקורית המתאימה.
  • num_true: מספר התוויות האמיתיות לכל הקשר.
  • num_sampled: מספר המועמדים לדגימה אקראית.
  • ייחודי: אם ייחודי הוא נכון, אנו דוגמים עם דחייה, כך שכל המועמדים שנדגמו באצווה יהיו ייחודיים. זה דורש קירוב מסוים כדי להעריך את הסתברויות הדגימה שלאחר הדחייה.
  • range_max: הדגימה תדגום מספרים שלמים מהמרווח [0, range_max).

מאפיינים אופציונליים (ראה Attrs ):

  • seed: אם ה-seed או seed2 מוגדרים כלא-אפס, מחולל המספרים האקראיים מוזרע על ידי ה-seed הנתון. אחרת, הוא נזרע על ידי זרע אקראי.
  • seed2: זרע שני כדי למנוע התנגשות זרע.

החזרות:

  • Output sampled_candidates: וקטור באורך num_sampled, שבו כל אלמנט הוא המזהה של מועמד שנדגם.
  • Output true_expected_count: מטריצת batch_size * num_true, המייצגת את מספר הפעמים שכל מועמד צפוי להתרחש באצווה של מועמדים שנדגמו. אם ייחודי=נכון, אז זו הסתברות.
  • Output sampled_expected_count: וקטור באורך num_sampled, עבור כל מועמד שנדגם המייצג את מספר הפעמים שהמועמד צפוי להתרחש בקבוצה של מועמדים שנדגמו. אם ייחודי=נכון, אז זו הסתברות.

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

LearnedUnigramCandidateSampler (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)
LearnedUnigramCandidateSampler (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const LearnedUnigramCandidateSampler::Attrs & attrs)

תכונות ציבוריות

operation
sampled_candidates
sampled_expected_count
true_expected_count

פונקציות סטטיות ציבוריות

Seed (int64 x)
Seed2 (int64 x)

מבנים

tensorflow:: ops:: LearnedUnigramCandidateSampler:: Attrs

קובעי תכונות אופציונליים עבור LearnedUnigramCandidateSampler .

תכונות ציבוריות

מבצע

Operation operation

sampled_candidates

::tensorflow::Output sampled_candidates

sampled_expected_count

::tensorflow::Output sampled_expected_count

true_expected_count

::tensorflow::Output true_expected_count

תפקידים ציבוריים

LearnedUnigramCandidateSampler

 LearnedUnigramCandidateSampler(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input true_classes,
  int64 num_true,
  int64 num_sampled,
  bool unique,
  int64 range_max
)

LearnedUnigramCandidateSampler

 LearnedUnigramCandidateSampler(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input true_classes,
  int64 num_true,
  int64 num_sampled,
  bool unique,
  int64 range_max,
  const LearnedUnigramCandidateSampler::Attrs & attrs
)

פונקציות סטטיות ציבוריות

זֶרַע

Attrs Seed(
  int64 x
)

זרע 2

Attrs Seed2(
  int64 x
)