tensorflow:: ops:: ComputeAccidentalHits
#include <candidate_sampling_ops.h>sampled_candidates 内の、true_labels に一致する位置の ID を計算します。
まとめ
対数オッズNCEを実行する場合、この演算の結果をSparseToDense演算に通し、サンプリングされた候補のロジットに加算する必要があります。これにより、分類器がサンプリングされたラベルであることを確実に認識することで、真のラベルと一致するサンプリングされたラベルを「削除」する効果が得られます。
議論:
- スコープ:スコープオブジェクト
- true_classes: UnpackSparseLabels の出力である true_classes。
- sampled_candidates: CandidateSampler の出力結果 sampled_candidates。
- num_true: Number of true labels per context.
オプション属性( Attrs参照):
- seed: seedまたはseed2のいずれかがゼロ以外の値に設定されている場合、乱数生成器は指定されたシード値で初期化されます。それ以外の場合は、ランダムなシード値で初期化されます。
- seed2: シードの衝突を避けるための2つ目のシード。
返品:
-
Outputインデックス: true_candidates の各行に対応するインデックスのベクトル。 -
OutputID: sampled_candidates内の位置のうち、indices内の対応するインデックスを持つ行のtrue_labelと一致する位置のIDのベクトル。 -
Output重み: インデックスと ID と同じ長さのベクトルで、各要素は -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
指数
::tensorflow::Output indices
手術
Operation operation
重さ
::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 )
パブリック静的関数
シード
Attrs Seed( int64 x )
シード2
Attrs Seed2( int64 x )