تدفق التوتر:: العمليات:: SparseApplyMomentum

#include <training_ops.h>

قم بتحديث الإدخالات ذات الصلة في '*var' و'*accum' وفقًا لمخطط الزخم.

ملخص

اضبط use_nesterov = True إذا كنت تريد استخدام زخم Nesterov.

هذا بالنسبة للصفوف التي لدينا grad لها، نقوم بتحديث var وaccum على النحو التالي:

$$accum = accum * momentum + grad$$
$$var -= lr * accum$$

الحجج:

  • النطاق: كائن النطاق
  • فار: يجب أن يكون من متغير ().
  • تراكم: يجب أن يكون من متغير ().
  • ل: معدل التعلم. يجب أن يكون العددية.
  • غراد: التدرج.
  • المؤشرات: متجه للمؤشرات في البعد الأول من var وaccum.
  • الزخم : الزخم . يجب أن يكون العددية.

السمات الاختيارية (انظر Attrs ):

  • use_locking: إذا كان True ، فسيتم حماية تحديث موترتي var وaccum بواسطة قفل؛ وإلا فإن السلوك غير محدد، ولكنه قد يحمل قدرًا أقل من الخلاف.
  • use_nesterov: إذا كان True ، فإن الموتر الذي تم تمريره لحساب الدرجة سيكون var - lr * الزخم * تراكم، لذا في النهاية، فإن var الذي تحصل عليه هو في الواقع var - lr * الزخم * تراكم.

عائدات:

البنائين والمدمرين

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 

وظائف ثابتة العامة

UseLocking

Attrs UseLocking(
  bool x
)

استخدم نيستيروف

Attrs UseNesterov(
  bool x
)