เทนเซอร์โฟลว์:: ออปส์:: เอกลักษณ์เอ็น

#include <array_ops.h>

ส่งคืนลิสต์ของเทนเซอร์ที่มีรูปร่างและเนื้อหาเหมือนกับข้อมูลที่ป้อนเข้ามา

สรุป

เทนเซอร์

ตัวดำเนินการนี้สามารถใช้เพื่อแทนที่ค่าเกรเดียนต์สำหรับฟังก์ชันที่ซับซ้อนได้ ตัวอย่างเช่น สมมติว่า y = f(x) และเราต้องการใช้ฟังก์ชัน g ที่กำหนดเองสำหรับการแพร่กระจายย้อนกลับ (backprop) เพื่อให้ dx = g(dy) ใน Python

with tf.get_default_graph().gradient_override_map(
    {'IdentityN': 'OverrideGradientWithG'}):
  y, _ = identity_n([f(x), x])

.RegisterGradient('OverrideGradientWithG')
def ApplyG(op, dy, _):
  return [None, g(dy)]  # Do not backprop to f(x).

ข้อโต้แย้ง:

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

  • OutputList : เทนเซอร์ผลลัพธ์

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

IdentityN (const :: tensorflow::Scope & scope, :: tensorflow::InputList input)

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

operation
output

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

operator[] (size_t index) const

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

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

Operation operation

เอาต์พุต

::tensorflow::OutputList output

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

อัตลักษณ์เอ็น

 IdentityN(
  const ::tensorflow::Scope & scope,
  ::tensorflow::InputList input
)

ผู้ดำเนินการ[]

::tensorflow::Output operator[](
  size_t index
) const