tensorflow::ops::ComputeAccidentalHits
#include <candidate_sampling_ops.h>
Вычисляет идентификаторы позиций в sampled_candidates, которые соответствуют true_labels.
Summary
При использовании log-odds NCE результат этой операции должен передаваться через операцию SparseToDense, а затем добавляться к значениям logits выбранных кандидатов. Это приводит к 'удалению' выбранных меток, которые совпадают с истинными метками, гарантируя, что они являются выбранными метками.
Аргументы:
- scope: Объект Scope
- true_classes: Результат true_classes из UnpackSparseLabels.
- sampled_candidates: Результат sampled_candidates из CandidateSampler.
- num_true: Количество истинных меток на контекст.
Необязательные атрибуты (см. Attrs):
- seed: Если seed или seed2 отличны от нуля, генератор случайных чисел инициализируется заданным seed. В противном случае, он инициализируется случайным seed.
- seed2: Второе значение seed для предотвращения столкновений seed.
Возвращает:
-
Outputindices: Вектор индексов, соответствующих строкам true_candidates. -
Outputids: Вектор идентификаторов позиций в sampled_candidates, которые соответствуют true_label для строки с соответствующим индексом в indices. -
Outputweights: Вектор той же длины, что и indices и ids, в котором каждый элемент равен -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. |
Общедоступные атрибуты
ids
::tensorflow::Output ids
indices
::tensorflow::Output indices
operation
Operation operation
weights
::tensorflow::Output weights
Общедоступные функции
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 )
Общедоступные статические функции
Seed
Attrs Seed( int64 x )
Seed2
Attrs Seed2( int64 x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/compute-accidental-hits