tensorflow:: ops:: UniformCandidateSampler

#include <candidate_sampling_ops.h>

一様分布に従って候補サンプルのラベルを生成します。

まとめ

候補サンプリングとデータ形式の説明については、go/candidate-sampling を参照してください。

この操作は、各バッチに対して、サンプリングされた候補ラベルのセットを1つ選択します。

バッチごとに候補をサンプリングする利点は、シンプルさと効率的な密行列乗算が可能であることである。欠点は、サンプリングされた候補をコンテキストや真のラベルとは無関係に選択する必要があることである。

議論:

  • スコープ:スコープオブジェクト
  • true_classes: batch_size * num_true の行列。各行には、対応する元のラベル内の num_true 個の target_classes の ID が含まれます。
  • num_true: コンテキストごとの真のラベルの数。
  • num_sampled: ランダムにサンプリングする候補の数。
  • unique: uniqueが真の場合、棄却サンプリングを行い、バッチ内のサンプリングされた候補はすべて一意になるようにします。これには、棄却後のサンプリング確率を推定するための近似計算が必要です。
  • range_max: サンプラーは区間[0, range_max)から整数をサンプリングします。

オプション属性( Attrs参照):

  • seed: seedまたはseed2のいずれかがゼロ以外の値に設定されている場合、乱数生成器は指定されたシード値で初期化されます。それ以外の場合は、ランダムなシード値で初期化されます。
  • seed2: シードの衝突を避けるための2つ目のシード。

返品:

  • Output sampled_candidates: 長さ num_sampled のベクトル。各要素はサンプリングされた候補の ID です。
  • Output true_expected_count: バッチサイズ * num_true の行列。サンプリングされた候補のバッチ内で各候補が出現すると予想される回数を表します。unique=true の場合、これは確率です。
  • Output sampled_expected_count: 長さ num_sampled のベクトル。サンプリングされた候補ごとに、その候補がサンプリングされた候補のバッチ内で出現すると予想される回数を表します。unique=true の場合、これは確率です。

コンストラクターとデストラクタ

UniformCandidateSampler (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)
UniformCandidateSampler (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const UniformCandidateSampler::Attrs & attrs)

公開属性

operation
sampled_candidates
sampled_expected_count
true_expected_count

パブリック静的関数

Seed (int64 x)
Seed2 (int64 x)

構造

tensorflow:: ops:: UniformCandidateSampler:: Attrs

UniformCandidateSamplerのオプション属性セッター。

公開属性

手術

Operation operation

サンプリングされた候補者

::tensorflow::Output sampled_candidates

サンプリングされた期待値

::tensorflow::Output sampled_expected_count

真の期待値

::tensorflow::Output true_expected_count

公的機能

ユニフォーム候補サンプラー

 UniformCandidateSampler(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input true_classes,
  int64 num_true,
  int64 num_sampled,
  bool unique,
  int64 range_max
)

ユニフォーム候補サンプラー

 UniformCandidateSampler(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input true_classes,
  int64 num_true,
  int64 num_sampled,
  bool unique,
  int64 range_max,
  const UniformCandidateSampler::Attrs & attrs
)

パブリック静的関数

シード

Attrs Seed(
  int64 x
)

シード2

Attrs Seed2(
  int64 x
)