Spec-Zone.ru › TensorFlow C++

tensorflow::ops::ComputeAccidentalHits

#include <candidate_sampling_ops.h>

Вычисляет идентификаторы позиций в sampled_candidates, соответствующих true_labels.

Краткое описание

При использовании NCE с логарифмом отношения шансов результат этой операции следует передать в операцию SparseToDense, а затем прибавить к логитам выбранных кандидатов. Это позволяет «удалить» выбранные метки, совпадающие с истинными метками, убедив классификатор в том, что они являются выбранными метками.

Аргументы:

  • scope: объект Scope
  • true_classes: результат UnpackSparseLabels с именем true_classes.
  • sampled_candidates: результат CandidateSampler с именем sampled_candidates.
  • num_true: количество истинных меток для каждого контекста.

Необязательные атрибуты (см. Attrs):

  • seed: Если для seed или seed2 задано ненулевое значение, генератор случайных чисел инициализируется указанным значением. В противном случае используется случайное начальное значение.
  • seed2: Второе начальное значение, позволяющее избежать совпадения начальных значений.

Возвращает:

  • Output indices: вектор индексов, соответствующих строкам true_candidates.
  • Output ids: вектор идентификаторов позиций в sampled_candidates, соответствующих true_label для строки с соответствующим индексом в indices.
  • Output weights: вектор той же длины, что и 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
::tensorflow::Output
indices
::tensorflow::Output
operation
Operation
weights
::tensorflow::Output
Публичные статические функции
Seed(int64 x)
Attrs
Seed2(int64 x)
Attrs
Структуры
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
)

© 2022 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 4.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/compute-accidental-hits

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API