aliran tensor:: operasi:: ComputeAccidentalHits

#include <candidate_sampling_ops.h>

Menghitung id posisi di sampled_candidates yang cocok dengan true_labels.

Ringkasan

Saat melakukan log-odds NCE, hasil operasi ini harus diteruskan melalui operasi SparseToDense, kemudian ditambahkan ke logit kandidat sampel. Ini memiliki efek 'menghapus' label sampel yang cocok dengan label sebenarnya dengan memastikan pengklasifikasi bahwa mereka adalah label sampel.

Argumen:

  • ruang lingkup: Objek Lingkup
  • true_classes: Output true_classes dari UnpackSparseLabels.
  • sampled_candidates: Output sampled_candidates dari CandidateSampler.
  • num_true: Jumlah label yang benar per konteks.

Atribut opsional (lihat Attrs ):

  • seed: Jika seed atau seed2 disetel menjadi bukan nol, generator angka acak diunggulkan oleh seed yang diberikan. Jika tidak, itu diunggulkan oleh benih acak.
  • seed2: Benih kedua untuk menghindari tumbukan benih.

Pengembalian:

  • Indeks Output : Sebuah vektor indeks yang sesuai dengan baris true_candidates.
  • Id Output : Vektor ID posisi di sampled_candidates yang cocok dengan true_label untuk baris dengan indeks yang sesuai dalam indeks.
  • Bobot Output : Sebuah vektor dengan panjang yang sama dengan indeks dan id, di mana setiap elemen adalah -FLOAT_MAX.

Konstruktor dan Destructor

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)

Atribut publik

ids
indices
operation
weights

Fungsi statis publik

Seed (int64 x)
Seed2 (int64 x)

Struktur

tensorflow:: ops:: ComputeAccidentalHits:: Attrs

Penyetel atribut opsional untuk ComputeAccidentalHits .

Atribut publik

id

::tensorflow::Output ids

indeks

::tensorflow::Output indices

operasi

Operation operation

beban

::tensorflow::Output weights

Fungsi publik

ComputeAccidentalHits

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

ComputeAccidentalHits

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

Fungsi statis publik

Benih

Attrs Seed(
  int64 x
)

Benih2

Attrs Seed2(
  int64 x
)