dòng chảy :: hoạt động :: SparseApplyFtrl

#include <training_ops.h>

Cập nhật các mục nhập có liên quan trong '* var' theo lược đồ Ftrl-proximal.

Tóm lược

Đó là đối với các hàng mà chúng tôi có grad, chúng tôi cập nhật var, Accu và tuyến tính như sau:

$$accum_new = accum + grad * grad$$
$$linear += grad + (accum_{new}^{-lr_{power} } - accum^{-lr_{power} } / lr * var$$
$$quadratic = 1.0 / (accum_{new}^{lr_{power} } * lr) + 2 * l2$$
$$var = (sign(linear) * l1 - linear) / quadratic\ if\ |linear| > l1\ else\ 0.0$$
$$accum = accum_{new}$$

Tranh luận:

  • phạm vi: Một đối tượng Phạm vi
  • var: Phải từ một Biến ().
  • Tích lũy: Phải từ một Biến ().
  • tuyến tính: Phải từ một Biến ().
  • grad: Độ dốc.
  • chỉ số: Một vectơ của các chỉ số trong thứ nguyên đầu tiên của var và Accu.
  • lr: Hệ số tỷ lệ. Phải là một vô hướng.
  • l1: Chính quy hóa L1. Phải là một vô hướng.
  • l2: Chính quy hóa L2. Phải là một vô hướng.
  • lr_power: Hệ số tỷ lệ. Phải là một vô hướng.

Các thuộc tính tùy chọn (xem Phần Attrs ):

  • use_locking: Nếu True , việc cập nhật hàng chục var và tích lũy sẽ được bảo vệ bằng một khóa; nếu không thì hành vi không được xác định, nhưng có thể ít biểu hiện sự cạnh tranh hơn.

Lợi nhuận:

  • Output : Giống như "var".

Người xây dựng và Người phá hủy

SparseApplyFtrl (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input linear, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input lr, :: tensorflow::Input l1, :: tensorflow::Input l2, :: tensorflow::Input lr_power)
SparseApplyFtrl (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input linear, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input lr, :: tensorflow::Input l1, :: tensorflow::Input l2, :: tensorflow::Input lr_power, const SparseApplyFtrl::Attrs & attrs)

Thuộc tính công khai

operation
out

Chức năng công cộng

node () const
::tensorflow::Node *
operator::tensorflow::Input () const
operator::tensorflow::Output () const

Chức năng tĩnh công khai

UseLocking (bool x)

Cấu trúc

tensorflow :: ops :: SparseApplyFtrl :: Attrs

Bộ thiết lập thuộc tính tùy chọn cho SparseApplyFtrl .

Thuộc tính công khai

hoạt động

Operation operation

ngoài

::tensorflow::Output out

Chức năng công cộng

SparseApplyFtrl

 SparseApplyFtrl(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input var,
  ::tensorflow::Input accum,
  ::tensorflow::Input linear,
  ::tensorflow::Input grad,
  ::tensorflow::Input indices,
  ::tensorflow::Input lr,
  ::tensorflow::Input l1,
  ::tensorflow::Input l2,
  ::tensorflow::Input lr_power
)

SparseApplyFtrl

 SparseApplyFtrl(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input var,
  ::tensorflow::Input accum,
  ::tensorflow::Input linear,
  ::tensorflow::Input grad,
  ::tensorflow::Input indices,
  ::tensorflow::Input lr,
  ::tensorflow::Input l1,
  ::tensorflow::Input l2,
  ::tensorflow::Input lr_power,
  const SparseApplyFtrl::Attrs & attrs
)

nút

::tensorflow::Node * node() const 

toán tử :: tensorflow :: Đầu vào

 operator::tensorflow::Input() const 

toán tử :: tensorflow :: Đầu ra

 operator::tensorflow::Output() const 

Chức năng tĩnh công khai

UseLocking

Attrs UseLocking(
  bool x
)