tensorflow:: ops:: ResourceSparseApplyMomentum
#include <training_ops.h>עדכון ערכים רלוונטיים ב-'*var' וב-'*accum' בהתאם לסכימת המומנטום.
תַקצִיר
הגדר use_nesterov = True אם ברצונך להשתמש במומנט נסטרוב.
זה עבור שורות שיש לנו grad עבורן, אנחנו מעדכנים את var ו- accum באופן הבא:
accum = accum * מומנטום + grad var -= lr * accum
טיעונים:
- היקף: אובייקט היקף
- var: צריך להיות מתוך Variable().
- accum: צריך להיות מ-Variable().
- lr: קצב למידה. חייב להיות סקלרי.
- גראד: הגרדיאנט.
- אינדקסים: וקטור של אינדקסים לתוך המימד הראשון של var ו- accum.
- תנע: תנע. חייב להיות סקלרי.
מאפיינים אופציונליים (ראה Attrs ):
- use_locking: אם
True, עדכון הטנזורים var ו-accum יהיה מוגן על ידי נעילה; אחרת ההתנהגות אינה מוגדרת, אך עשויה להפגין פחות תחרות. - use_nesterov: אם
True, הטנזור המועבר לחישוב ה-grad יהיה var - lr * momentum * accum, כך שבסופו של דבר, ה-var שמתקבל הוא למעשה var - lr * momentum * accum.
החזרות:
-
Operationשנוצרה
בנאים והורסים | |
|---|---|
ResourceSparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum) | |
ResourceSparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum, const ResourceSparseApplyMomentum::Attrs & attrs) |
מאפיינים ציבוריים | |
|---|---|
operation | |
תפקידים ציבוריים | |
|---|---|
operator::tensorflow::Operation () const | |
פונקציות סטטיות ציבוריות | |
|---|---|
UseLocking (bool x) | |
UseNesterov (bool x) | |
מבנים | |
|---|---|
| tensorflow:: ops:: ResourceSparseApplyMomentum:: Attrs | קובעי מאפיינים אופציונליים עבור ResourceSparseApplyMomentum . |
מאפיינים ציבוריים
מִבצָע
Operation operation
תפקידים ציבוריים
משאבים דלילים ביישומים מומנטום
ResourceSparseApplyMomentum( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input indices, ::tensorflow::Input momentum )
משאבים דלילים ביישומים מומנטום
ResourceSparseApplyMomentum( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input indices, ::tensorflow::Input momentum, const ResourceSparseApplyMomentum::Attrs & attrs )
אופרטור::tensorflow::Operation
operator::tensorflow::Operation() const
פונקציות סטטיות ציבוריות
שימוש בנעילה
Attrs UseLocking( bool x )
יוזנסטרוב
Attrs UseNesterov( bool x )
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2026-11-05 (שעון UTC).
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-11-05 (שעון UTC)."],[],[]]