tensorflow:: ops:: SparseApplyMomentum
#include <training_ops.h>Update relevant entries in '*var' and '*accum' according to the momentum scheme.
まとめ
Set use_nesterov = True if you want to use Nesterov momentum.
That is for rows we have grad for, we update var and accum as follows:
$$accum = accum * momentum + grad$$
$$var -= lr * accum$$
議論:
- スコープ:スコープオブジェクト
- var: Variable() から取得する必要があります。
- accum: Variable() から取得する必要があります。
- lr: 学習率。スカラー値である必要があります。
- grad: 勾配。
- indices: A vector of indices into the first dimension of var and accum.
- 運動量:運動量。スカラー値である必要があります。
オプション属性( Attrs参照):
- use_locking: If
True, updating of the var and accum tensors will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention. - use_nesterov: If
True, the tensor passed to compute grad will be var - lr * momentum * accum, so in the end, the var you get is actually 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 | Optional attribute setters for 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 )