tensorflow::ops::ApplyMomentum
#include <training_ops.h>
Обновление '*var' по схеме импульса.
Summary
Установите use_nesterov = True, если хотите использовать импульс Нестерова.
accum = accum * momentum + grad var -= lr * accum
Аргументы:
- scope: Объект Scope
- var: Должен быть получен из Variable().
- accum: Должен быть получен из Variable().
- lr: Коэффициент масштабирования. Должен быть скаляром.
- grad: Градиент.
- momentum: Импульс. Должен быть скаляром.
Необязательные атрибуты (см. Attrs):
- use_locking: Если
True, обновление тензоров var и accum будет защищено блокировкой; в противном случае поведение не определено, но может быть менее конкурентным. - use_nesterov: Если
True, тензор, переданный для вычисления grad, будет var - lr * momentum * accum, поэтому в итоге var, который вы получите, фактически будет var - lr * momentum * accum.
Возвращает:
-
Output: То же, что и "var".
| Конструкторы и деструкторы | |
|---|---|
ApplyMomentum(const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input momentum) | |
ApplyMomentum(const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input momentum, const ApplyMomentum::Attrs & attrs) |
| Общедоступные атрибуты | |
|---|---|
operation | |
out | |
| Общедоступные функции | |
|---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const | |
| Общедоступные статические функции | |
|---|---|
UseLocking(bool x) | |
UseNesterov(bool x) | |
| Структуры | |
|---|---|
| tensorflow::ops::ApplyMomentum::Attrs | Необязательные установщики атрибутов для ApplyMomentum. |
Общедоступные атрибуты
operation
Operation operation
out
::tensorflow::Output out
Общедоступные функции
ApplyMomentum
ApplyMomentum( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input momentum )
ApplyMomentum
ApplyMomentum( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input lr, ::tensorflow::Input grad, ::tensorflow::Input momentum, const ApplyMomentum::Attrs & attrs )
node
::tensorflow::Node * node() const
operator::tensorflow::Input
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Общедоступные статические функции
UseLocking
Attrs UseLocking( bool x )
UseNesterov
Attrs UseNesterov( bool x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/apply-momentum