tensorflow:: ops:: SparseApplyMomentum

#include <training_ops.h>

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

ملخص

قم بتعيين use_nesterov = True إذا كنت ترغب في استخدام زخم نيستروف.

بالنسبة للصفوف التي لدينا تدرج لها، نقوم بتحديث المتغير والتراكم على النحو التالي:

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

الحجج:

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

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

  • استخدام القفل: إذا كانت True ، فسيتم حماية تحديث موترات var و accum بواسطة قفل؛ وإلا فإن السلوك غير محدد، ولكنه قد يُظهر تنازعًا أقل.
  • use_nesterov: إذا كانت True ، فسيكون الموتر الذي تم تمريره لحساب التدرج هو var - lr * momentum * accum، لذلك في النهاية، يكون المتغير الذي تحصل عليه هو في الواقع var - lr * momentum * 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)

السمات العامة

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(
  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
)

العقدة

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

الدوال الثابتة العامة

قفل الاستخدام

Attrs UseLocking(
  bool x
)

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

Attrs UseNesterov(
  bool x
)