aliran tensor:: operasi:: TerapkanAdam
#include <training_ops.h>
Perbarui '*var' sesuai dengan algoritma Adam.
Ringkasan
$$lr_t := {learning_rate} * {1 - beta_2^t} / (1 - beta_1^t)$$
$$m_t := beta_1 * m_{t-1} + (1 - beta_1) * g$$
$$v_t := beta_2 * v_{t-1} + (1 - beta_2) * g * g$$
$$variable := variable - lr_t * m_t / ({v_t} + )$$
Argumen:
- ruang lingkup: Objek Lingkup
- var: Harus dari Variabel().
- m: Harus dari Variabel().
- v: Harus dari Variabel().
- beta1_power: Harus berupa skalar.
- beta2_power: Harus berupa skalar.
- lr: Faktor penskalaan. Pasti skalar.
- beta1: Faktor momentum. Pasti skalar.
- beta2: Faktor momentum. Pasti skalar.
- epsilon: Istilah punggungan. Pasti skalar.
- lulusan: Gradien.
Atribut opsional (lihat Attrs
):
- use_locking: Jika
True
, pembaruan tensor var, m, dan v akan dilindungi oleh kunci; jika tidak, perilaku tersebut tidak terdefinisikan, namun mungkin menunjukkan lebih sedikit pertentangan. - use_nesterov: Jika
True
, gunakan pembaruan nesterov.
Pengembalian:
-
Output
: Sama seperti "var".
Konstruktor dan Destruktor | |
---|---|
ApplyAdam (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input m, :: tensorflow::Input v, :: tensorflow::Input beta1_power, :: tensorflow::Input beta2_power, :: tensorflow::Input lr, :: tensorflow::Input beta1, :: tensorflow::Input beta2, :: tensorflow::Input epsilon, :: tensorflow::Input grad) | |
ApplyAdam (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input m, :: tensorflow::Input v, :: tensorflow::Input beta1_power, :: tensorflow::Input beta2_power, :: tensorflow::Input lr, :: tensorflow::Input beta1, :: tensorflow::Input beta2, :: tensorflow::Input epsilon, :: tensorflow::Input grad, const ApplyAdam::Attrs & attrs) |
Atribut publik | |
---|---|
operation | |
out |
Fungsi publik | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Fungsi statis publik | |
---|---|
UseLocking (bool x) | |
UseNesterov (bool x) |
Struktur | |
---|---|
tensorflow:: ops:: ApplyAdam:: Attrs | Penyetel atribut opsional untuk ApplyAdam . |
Atribut publik
operasi
Operation operation
keluar
::tensorflow::Output out
Fungsi publik
TerapkanAdam
ApplyAdam( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input m, ::tensorflow::Input v, ::tensorflow::Input beta1_power, ::tensorflow::Input beta2_power, ::tensorflow::Input lr, ::tensorflow::Input beta1, ::tensorflow::Input beta2, ::tensorflow::Input epsilon, ::tensorflow::Input grad )
TerapkanAdam
ApplyAdam( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input m, ::tensorflow::Input v, ::tensorflow::Input beta1_power, ::tensorflow::Input beta2_power, ::tensorflow::Input lr, ::tensorflow::Input beta1, ::tensorflow::Input beta2, ::tensorflow::Input epsilon, ::tensorflow::Input grad, const ApplyAdam::Attrs & attrs )
simpul
::tensorflow::Node * node() const
operator::tensorflow::Masukan
operator::tensorflow::Input() const
operator::tensorflow::Keluaran
operator::tensorflow::Output() const
Fungsi statis publik
Gunakan Penguncian
Attrs UseLocking( bool x )
GunakanNesterov
Attrs UseNesterov( bool x )