aliran tensor:: operasi:: TerapkanFtrlV2
#include <training_ops.h>
Perbarui '*var' sesuai dengan skema Ftrl-proksimal.
Ringkasan
grad_with_shrinkage = grad + 2 * l2_shrinkage * var accum_new = accum + grad * grad linear += grad_with_shrinkage - (accum_new^(-lr_power) - accum^(-lr_power)) / lr * var kuadrat = 1.0 / (accum_new^(lr_power) * lr) + 2 * l2 var = (tanda(linier) * l1 - linier) / kuadrat jika |linier| > l1 lain 0,0 akumulasi = akumulasi_baru
Argumen:
- ruang lingkup: Objek Lingkup
- var: Harus dari Variabel().
- accum: Harus dari Variabel().
- linier: Harus dari Variabel().
- lulusan: Gradien.
- lr: Faktor penskalaan. Pasti skalar.
- l1: Regularisasi L1. Pasti skalar.
- l2: Regularisasi penyusutan L2. Pasti skalar.
- lr_power: Faktor penskalaan. Pasti skalar.
Atribut opsional (lihat Attrs
):
- use_locking: Jika
True
, pembaruan tensor var dan accum akan dilindungi oleh kunci; jika tidak, perilaku tersebut tidak terdefinisikan, namun mungkin menunjukkan lebih sedikit pertentangan.
Pengembalian:
-
Output
: Sama seperti "var".
Konstruktor dan Destruktor | |
---|---|
ApplyFtrlV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input linear, :: tensorflow::Input grad, :: tensorflow::Input lr, :: tensorflow::Input l1, :: tensorflow::Input l2, :: tensorflow::Input l2_shrinkage, :: tensorflow::Input lr_power) | |
ApplyFtrlV2 (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input linear, :: tensorflow::Input grad, :: tensorflow::Input lr, :: tensorflow::Input l1, :: tensorflow::Input l2, :: tensorflow::Input l2_shrinkage, :: tensorflow::Input lr_power, const ApplyFtrlV2::Attrs & attrs) |
Atribut publik | |
---|---|
operation | |
out |
Fungsi publik | |
---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const |
Fungsi statis publik | |
---|---|
MultiplyLinearByLr (bool x) | |
UseLocking (bool x) |
Struktur | |
---|---|
tensorflow:: ops:: ApplyFtrlV2:: Attrs | Penyetel atribut opsional untuk ApplyFtrlV2 . |
Atribut publik
operasi
Operation operation
keluar
::tensorflow::Output out
Fungsi publik
TerapkanFtrlV2
ApplyFtrlV2( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input linear, ::tensorflow::Input grad, ::tensorflow::Input lr, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input l2_shrinkage, ::tensorflow::Input lr_power )
TerapkanFtrlV2
ApplyFtrlV2( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input accum, ::tensorflow::Input linear, ::tensorflow::Input grad, ::tensorflow::Input lr, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input l2_shrinkage, ::tensorflow::Input lr_power, const ApplyFtrlV2::Attrs & attrs )
simpul
::tensorflow::Node * node() const
operator::tensorflow::Masukan
operator::tensorflow::Input() const
operator::tensorflow::Keluaran
operator::tensorflow::Output() const
Fungsi statis publik
KalikanLinearByLr
Attrs MultiplyLinearByLr( bool x )
Gunakan Penguncian
Attrs UseLocking( bool x )