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: צריך להיות מ-Variable().
  • lr: קצב למידה. חייב להיות סקלר.
  • grad: השיפוע.
  • מדדים: וקטור של מדדים למימד הראשון של var ו-acum.
  • מומנטום: מומנטום. חייב להיות סקלר.

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

  • use_locking: אם True , עדכון של טנסור ה-var ו-acum יהיה מוגן על ידי מנעול; אחרת ההתנהגות אינה מוגדרת, אך עלולה להפגין פחות מחלוקת.
  • use_nesterov: אם True , הטנזור שיעבור לחישוב גראד יהיה var - lr * מומנטום * accum, אז בסופו של דבר, ה- var שתקבל הוא למעשה var - lr * מומנטום * accum.

החזרות:

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

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)

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

operation
out

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

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
)

צוֹמֶת

::tensorflow::Node * node() const 

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

 operator::tensorflow::Input() const 

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

 operator::tensorflow::Output() const 

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

השתמש בנעילה

Attrs UseLocking(
  bool x
)

השתמש ב-Nesterov

Attrs UseNesterov(
  bool x
)