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