tensorflow::ops::ResourceSparseApplyMomentum

#include <training_ops.h>

อัปเดตรายการที่เกี่ยวข้องใน '*var' และ '*accum' ตามแผนการคำนวณโมเมนตัม

สรุป

ตั้งค่า use_nesterov = True หากต้องการใช้โมเมนตัมของ Nesterov

สำหรับแถวที่เรามีข้อมูลการสำเร็จการศึกษา เราจะอัปเดตค่าตัวแปรและค่าสะสมดังนี้:

สะสม = สะสม * โมเมนตัม + ผู้สำเร็จการศึกษา var -= lr * สะสม

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • var: ควรมาจาก Variable()
  • accum: ควรมาจาก Variable()
  • lr: อัตราการเรียนรู้ ต้องเป็นค่าคงที่ (scalar)
  • grad: ค่าความชัน
  • ดัชนี: เวกเตอร์ของดัชนีในมิติแรกของ var และ accum
  • โมเมนตัม: โมเมนตัม ต้องเป็นปริมาณสเกลาร์

คุณลักษณะเสริม (ดูที่ Attrs ):

  • use_locking: หากตั้งค่า True การอัปเดตเทนเซอร์ var และ accum จะได้รับการป้องกันด้วยการล็อก มิเช่นนั้นพฤติกรรมจะไม่แน่นอน แต่การแย่งชิงทรัพยากรอาจน้อยลง
  • use_nesterov: ถ้า True เทนเซอร์ที่ส่งไปยังฟังก์ชัน compute grad จะเป็น var - lr * momentum * accum ดังนั้นในท้ายที่สุด ค่า var ที่คุณได้รับก็คือ var - lr * momentum * accum นั่นเอง

การส่งคืนสินค้า:

  • Operation ที่สร้างขึ้น

ตัวสร้างและตัวทำลาย

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

คุณลักษณะสาธารณะ

operation

หน้าที่สาธารณะ

operator::tensorflow::Operation () const

ฟังก์ชันคงที่สาธารณะ

UseLocking (bool x)
UseNesterov (bool x)

โครงสร้าง

tensorflow::ops::ResourceSparseApplyMomentum::Attrs

ตัวเลือกในการตั้งค่าแอตทริบิวต์สำหรับ ResourceSparseApplyMomentum

คุณลักษณะสาธารณะ

การดำเนินการ

Operation operation

หน้าที่สาธารณะ

ทรัพยากรที่กระจัดกระจาย ประยุกต์ใช้โมเมนตัม

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

ทรัพยากรที่กระจัดกระจาย ประยุกต์ใช้โมเมนตัม

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

ตัวดำเนินการ::เทนเซอร์โฟลว์::การดำเนินการ

 operator::tensorflow::Operation() const 

ฟังก์ชันคงที่สาธารณะ

ใช้การล็อก

Attrs UseLocking(
  bool x
)

UseNesterov

Attrs UseNesterov(
  bool x
)