tensorflow::ops::ComputeAccidentalHits

#include <candidate_sampling_ops.h>

คำนวณหา ID ของตำแหน่งใน sampled_candidates ที่ตรงกับ true_labels

สรุป

เมื่อทำการคำนวณ NCE ด้วย log-odds ผลลัพธ์ของการดำเนินการนี้ควรส่งผ่านไปยังการดำเนินการ SparseToDense จากนั้นจึงบวกเข้ากับ logits ของตัวเลือกที่สุ่มมา การดำเนินการนี้จะมีผลในการ 'ลบ' ป้ายกำกับที่สุ่มมาซึ่งตรงกับป้ายกำกับจริง โดยทำให้ตัวจำแนกมั่นใจว่าป้ายกำกับเหล่านั้นเป็นป้ายกำกับที่สุ่มมา

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • true_classes: ค่า true_classes ที่ได้จากการทำงานของ UnpackSparseLabels
  • sampled_candidates: ผลลัพธ์ sampled_candidates จาก CandidateSampler
  • num_true: จำนวนป้ายกำกับที่เป็นจริงต่อบริบท

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

  • seed: หาก seed หรือ seed2 ตัวใดตัวหนึ่งถูกตั้งค่าเป็นค่าที่ไม่ใช่ศูนย์ ตัวสร้างเลขสุ่มจะเริ่มต้นด้วยค่า seed ที่กำหนดให้ มิฉะนั้น จะเริ่มต้นด้วยค่า seed แบบสุ่ม
  • seed2: เมล็ดพันธุ์ที่สองเพื่อหลีกเลี่ยงการชนกันของเมล็ดพันธุ์

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

  • ดัชนี Output : เวกเตอร์ของดัชนีที่สอดคล้องกับแถวของ true_candidates
  • รหัส Output : เวกเตอร์ของรหัสตำแหน่งใน sampled_candidates ที่ตรงกับ true_label สำหรับแถวที่มีดัชนีที่สอดคล้องกันใน indices
  • น้ำหนัก Output : เวกเตอร์ที่มีความยาวเท่ากับดัชนีและรหัส โดยที่แต่ละองค์ประกอบคือ -FLOAT_MAX

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

ComputeAccidentalHits (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, :: tensorflow::Input sampled_candidates, int64 num_true)
ComputeAccidentalHits (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, :: tensorflow::Input sampled_candidates, int64 num_true, const ComputeAccidentalHits::Attrs & attrs)

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

ids
indices
operation
weights

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

Seed (int64 x)
Seed2 (int64 x)

โครงสร้าง

tensorflow::ops::ComputeAccidentalHits::Attrs

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

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

รหัส

::tensorflow::Output ids

ดัชนี

::tensorflow::Output indices

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

Operation operation

น้ำหนัก

::tensorflow::Output weights

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

คำนวณการชนโดยไม่ได้ตั้งใจ

 ComputeAccidentalHits(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input true_classes,
  ::tensorflow::Input sampled_candidates,
  int64 num_true
)

คำนวณการชนโดยไม่ได้ตั้งใจ

 ComputeAccidentalHits(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input true_classes,
  ::tensorflow::Input sampled_candidates,
  int64 num_true,
  const ComputeAccidentalHits::Attrs & attrs
)

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

เมล็ดพันธุ์

Attrs Seed(
  int64 x
)

เมล็ดพันธุ์2

Attrs Seed2(
  int64 x
)