tensorflow :: ops :: UniformCandidateSampler
#include <candidate_sampling_ops.h>
균등 분포로 후보 샘플링에 대한 레이블을 생성합니다.
요약
go / candidate-sampling에서 후보 샘플링 및 데이터 형식에 대한 설명을 참조하세요.
각 배치에 대해이 작업은 샘플링 된 후보 라벨의 단일 세트를 선택합니다.
배치 당 샘플링 후보의 장점은 단순성과 효율적인 조밀 행렬 곱셈의 가능성입니다. 단점은 샘플 후보가 컨텍스트 및 실제 레이블과 독립적으로 선택되어야한다는 것입니다.
인수 :
- 범위 : 범위 개체
- true_classes : batch_size * num_true 행렬. 각 행에는 해당 원래 레이블에있는 num_true target_classes의 ID가 포함됩니다.
- num_true : 컨텍스트 당 실제 레이블 수.
- num_sampled : 무작위로 샘플링 할 후보의 수.
- unique : unique가 true 인 경우 거부로 샘플링하므로 배치의 모든 샘플링 된 후보가 고유합니다. 이를 위해서는 거부 후 샘플링 확률을 추정하기위한 근사치가 필요합니다.
- range_max : 샘플러는 간격 [0, range_max)에서 정수를 샘플링합니다.
선택적 속성 ( Attrs
참조) :
- seed : seed 또는 seed2가 0이 아닌 값으로 설정된 경우, 난수 생성기는 주어진 seed에 의해 seed됩니다. 그렇지 않으면 임의의 시드로 시드됩니다.
- seed2 : 시드 충돌을 피하기위한 두 번째 시드.
보고:
-
Output
sampled_candidates : 각 요소가 샘플링 된 후보의 ID 인 num_sampled 길이의 벡터입니다. -
Output
true_expected_count : 샘플 된 후보의 배치에서 각 후보가 발생할 것으로 예상되는 횟수를 나타내는 batch_size * 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
sampled_candidates
::tensorflow::Output sampled_candidates
sampled_expected_count
::tensorflow::Output sampled_expected_count
true_expected_count
::tensorflow::Output true_expected_count
공공 기능
UniformCandidateSampler
UniformCandidateSampler( const ::tensorflow::Scope & scope, ::tensorflow::Input true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max )
UniformCandidateSampler
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 )
Seed2
Attrs Seed2( int64 x )