tensorflow::ops::SparseApplyMomentum

#include <training_ops.h>

Cập nhật các mục liên quan trong '*var' và '*accum' theo sơ đồ động lượng.

Bản tóm tắt

Đặt `use_nesterov = True` nếu bạn muốn sử dụng động lượng Nesterov.

Đối với những hàng mà chúng ta đã có giá trị grad, chúng ta cập nhật var và accum như sau:

$$accum = accum * momentum + grad$$ $$var -= lr * accum$$

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().
  • lr: Tốc độ học. Phải là một đại lượng vô hướng.
  • grad: Độ dốc.
  • chỉ số: Một vectơ các chỉ số vào chiều thứ nhất của var và accum.
  • Động lượng: Động lượng. Phải là một đại lượng 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.
  • use_nesterov: Nếu True , tensor được truyền để tính grad sẽ là var - lr * momentum * accum, vì vậy cuối cùng, var bạn nhận được thực chất là var - lr * momentum * accum.

Trả về:

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

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

SparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum)
SparseApplyMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input indices, :: tensorflow::Input momentum, const SparseApplyMomentum::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

UseLocking (bool x)
UseNesterov (bool x)

Cấu trúc

tensorflow::ops::SparseApplyMomentum::Attrs

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

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

SparseApplyMomentum

 SparseApplyMomentum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input var,
  ::tensorflow::Input accum,
  ::tensorflow::Input lr,
  ::tensorflow::Input grad,
  ::tensorflow::Input indices,
  ::tensorflow::Input momentum
)

SparseApplyMomentum

 SparseApplyMomentum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input var,
  ::tensorflow::Input accum,
  ::tensorflow::Input lr,
  ::tensorflow::Input grad,
  ::tensorflow::Input indices,
  ::tensorflow::Input momentum,
  const SparseApplyMomentum::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

Sử dụng khóa

Attrs UseLocking(
  bool x
)

UseNesterov

Attrs UseNesterov(
  bool x
)