dòng chảy căng:: ôi:: Tài nguyênÁp dụngKerasĐộng lượng

#include <training_ops.h>

Cập nhật '*var' theo sơ đồ động lượng.

Bản tóm tắt

Đặt use_nesterov = Đúng nếu bạn

muốn sử dụng đà Nesterov.

tích lũy = tích lũy * động lượng - lr * grad var += tích lũy

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

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; mặt khác, hành vi không được xác định, nhưng có thể ít gây tranh cãi hơn.
  • use_nesterov: Nếu True thì tensor được truyền để tính grad sẽ là var + momen * accum, nên cuối cùng, var bạn nhận được thực tế là var + momen * accum.

Trả về:

Hàm tạo và hàm hủy

ResourceApplyKerasMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input momentum)
ResourceApplyKerasMomentum (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input accum, :: tensorflow::Input lr, :: tensorflow::Input grad, :: tensorflow::Input momentum, const ResourceApplyKerasMomentum::Attrs & attrs)

Thuộc tính công khai

operation

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

operator::tensorflow::Operation () const

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

UseLocking (bool x)
UseNesterov (bool x)

Cấu trúc

tensorflow:: ops:: ResourceApplyKerasMomentum:: Attrs

Trình thiết lập thuộc tính tùy chọn cho ResourceApplyKerasMomentum .

Thuộc tính công khai

hoạt động

Operation operation

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

Tài nguyênÁp dụngKerasĐộng lượng

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

Tài nguyênÁp dụngKerasĐộng lượng

 ResourceApplyKerasMomentum(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input var,
  ::tensorflow::Input accum,
  ::tensorflow::Input lr,
  ::tensorflow::Input grad,
  ::tensorflow::Input momentum,
  const ResourceApplyKerasMomentum::Attrs & attrs
)

toán tử::tenorflow::Hoạt động

 operator::tensorflow::Operation() const 

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

Sử dụngKhóa

Attrs UseLocking(
  bool x
)

Sử dụngNesterov

Attrs UseNesterov(
  bool x
)