tensorflow:: אופס:: SparseApplyMomentum
#include <training_ops.h>
עדכן ערכים רלוונטיים ב-'*var' ו-'*accum' בהתאם לתכנית המומנטום.
תַקצִיר
הגדר use_nesterov = True אם אתה רוצה להשתמש במומנטום Nesterov.
כלומר, עבור שורות שיש לנו גראד עבורן, אנו מעדכנים את var ומצטברים באופן הבא:
$$accum = accum * momentum + grad$$ $$var -= lr * accum$$
טיעונים:
- scope: אובייקט Scope
- var: צריך להיות מ-Variable().
- acum: צריך להיות ממשתנה().
- lr: קצב למידה. חייב להיות סקלר.
- grad: השיפוע.
- מדדים: וקטור של מדדים למימד הראשון של var ו-acum.
- מומנטום: מומנטום. חייב להיות סקלר.
מאפיינים אופציונליים (ראה Attrs
):
- use_locking: אם
True
, עדכון של טנסור ה-var ו-acum יהיה מוגן על ידי מנעול; אחרת ההתנהגות אינה מוגדרת, אך עלולה להפגין פחות מחלוקת. - use_nesterov: אם
True
, הטנזור שיעבור לחישוב גראד יהיה var - lr * מומנטום * accum, אז בסופו של דבר, ה- var שתקבל הוא למעשה var - lr * מומנטום * accum.
החזרות:
-
Output
: זהה ל-"var".
בנאים והורסים | |
---|---|
SparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum) | |
SparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum, const SparseApplyMomentum::Attrs & attrs) |
תפקידים ציבוריים | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
פונקציות סטטיות ציבוריות | |
---|---|
UseLocking (bool x) | |
UseNesterov (bool x) |
מבנים | |
---|---|
tensorflow:: ops:: SparseApplyMomentum:: Attrs | קובעי תכונות אופציונליים עבור SparseApplyMomentum . |
תכונות ציבוריות
מִבצָע
Operation operation
הַחוּצָה
::tensorflow::Output out
תפקידים ציבוריים
SparseApplyMomentum
SparseApplyMomentum( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input indices, ::tensorflow::Input momentum )
SparseApplyMomentum
SparseApplyMomentum( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input indices, ::tensorflow::Input momentum, const SparseApplyMomentum::Attrs & attrs )