tensorflow::ops::ApplyMomentum

#include <training_ops.h>

Cập nhật '*var' 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.

tích lũy = tích lũy * đà + grad var -= lr * tích lũy

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: Hệ số tỷ lệ. Phải là một đại lượng vô hướng.
  • grad: Độ dốc.
  • Độ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

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

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

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

Áp dụng động lực

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

Áp dụng động lực

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