tensorflow::ops::ApplyMomentum
#include <training_ops.h>
Обновляет '*var' в соответствии со схемой импульса.
Краткое описание
Установите 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 )
© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/apply-momentum