tensorflow:: ops:: SparseApplyMomentum

#include <training_ops.h>

モメンタム方式に従って、「*var」と「*accum」の関連エントリを更新します。

まとめ

ネステロフ運動量を使用する場合は、use_nesterov = True に設定してください。

これは、grad が利用可能な行について、var と accum を次のように更新する場合です。

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

議論:

  • スコープ:スコープオブジェクト
  • var: Variable() から取得する必要があります。
  • accum: Variable() から取得する必要があります。
  • lr: 学習率。スカラー値である必要があります。
  • grad: 勾配。
  • インデックス: var と accum の第 1 次元へのインデックスのベクトル。
  • 運動量:運動量。スカラー値である必要があります。

オプション属性( Attrs参照):

  • use_locking: Trueの場合、var および accum テンソルの更新はロックによって保護されます。それ以外の場合は動作は未定義ですが、競合が少なくなる可能性があります。
  • use_nesterov: Trueの場合、grad を計算するために渡されるテンソルは var - lr * momentum * accum になります。したがって、最終的に得られる var は実際には 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
)

UseNesterov

Attrs UseNesterov(
  bool x
)