tensorflow::ops::SparseApplyFtrlV2

#include <training_ops.h>

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

Bản tóm tắt

Đối với các hàng có giá trị grad, chúng ta cập nhật var, accum và linear như sau: 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 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

Luận điểm:

  • phạm vi: Một đối tượng Phạm vi
  • var: Nên được lấy từ một biến Variable().
  • tích lũy: Nên được lấy từ một biến().
  • tuyến tính: Nên được lấy từ một biến (Variable).
  • grad: Độ dốc.
  • chỉ số: Một vectơ các chỉ số vào chiều thứ nhất của var và accum.
  • lr: Hệ số tỷ lệ. Phải là một đại lượng vô hướng.
  • l1: Chuẩn hóa L1. Phải là một giá trị vô hướng.
  • l2: Chuẩn hóa co rút L2. Phải là một giá trị vô hướng.
  • lr_power: Hệ số tỷ lệ. Phải là một số vô hướng.

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

  • use_locking: Nếu True , việc cập nhật các tensor var và accum sẽ được bảo vệ bằng khóa; ngược lại, hành vi không được xác định, nhưng có thể ít xảy ra xung đột hơn.

Trả về:

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

Hàm khởi tạo và hàm hủy

SparseApplyFtrlV2 (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 l2_shrinkage, :: tensorflow::Input lr_power)
SparseApplyFtrlV2 (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 l2_shrinkage, :: tensorflow::Input lr_power, const SparseApplyFtrlV2::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

Các hàm tĩnh công khai

MultiplyLinearByLr (bool x)
UseLocking (bool x)

Cấu trúc

tensorflow::ops::SparseApplyFtrlV2::Attrs

Các thiết lập thuộc tính tùy chọn cho SparseApplyFtrlV2 .

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

SparseApplyFtrlV2

 SparseApplyFtrlV2(
  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 l2_shrinkage,
  ::tensorflow::Input lr_power
)

SparseApplyFtrlV2

 SparseApplyFtrlV2(
  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 l2_shrinkage,
  ::tensorflow::Input lr_power,
  const SparseApplyFtrlV2::Attrs & attrs
)

nút

::tensorflow::Node * node() const 

operator::tensorflow::Input

 operator::tensorflow::Input() const 

operator::tensorflow::Output

 operator::tensorflow::Output() const 

Các hàm tĩnh công khai

Nhân tuyến tính với Lr

Attrs MultiplyLinearByLr(
  bool x
)

Sử dụng khóa

Attrs UseLocking(
  bool x
)