텐서플로우:: ops:: FixedUnigramCandidateSampler:: Attrs

#include <candidate_sampling_ops.h>

FixedUnigramCandidateSampler 에 대한 선택적 속성 설정기입니다.

요약

공개 속성

distortion_ = 1.0f
float
num_reserved_ids_ = 0
int64
num_shards_ = 1
int64
seed2_ = 0
int64
seed_ = 0
int64
shard_ = 0
int64
unigrams_ = {}
gtl::ArraySlice< float >
vocab_file_ = ""
StringPiece

공공 기능

Distortion (float x)
TF_MUST_USE_RESULT Attrs
이 왜곡은 단어 확률 분포를 왜곡하는 데 사용됩니다.
NumReservedIds (int64 x)
TF_MUST_USE_RESULT Attrs
선택적으로 사용자는 [0, ..., num_reserved_ids) 범위 내에 예약된 ID를 추가할 수 있습니다.
NumShards (int64 x)
TF_MUST_USE_RESULT Attrs
샘플러는 원래 범위의 부분 집합에서 샘플링하여 병렬 처리를 통해 전체 계산 속도를 높이는 데 사용할 수 있습니다.
Seed (int64 x)
TF_MUST_USE_RESULT Attrs
seed 또는 seed2 중 하나라도 0이 아닌 값으로 설정되면, 난수 생성기는 지정된 시드 값으로 초기화됩니다.
Seed2 (int64 x)
TF_MUST_USE_RESULT Attrs
시드 충돌을 방지하기 위해 두 번째 시드를 사용합니다.
Shard (int64 x)
TF_MUST_USE_RESULT Attrs
샘플러는 원래 범위의 부분 집합에서 샘플링하여 병렬 처리를 통해 전체 계산 속도를 높이는 데 사용할 수 있습니다.
Unigrams (const gtl::ArraySlice< float > & x)
TF_MUST_USE_RESULT Attrs
각 ID별로 순차적으로 나열된 단어 개수 또는 확률 목록입니다.
VocabFile (StringPiece x)
TF_MUST_USE_RESULT Attrs
CSV 형식과 유사한 이 파일의 각 유효한 행은 유효한 단어 ID에 해당합니다.

공개 속성

왜곡_

float tensorflow::ops::FixedUnigramCandidateSampler::Attrs::distortion_ = 1.0f

예약된 ID 수

int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::num_reserved_ids_ = 0

num_shards_

int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::num_shards_ = 1

시드2_

int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::seed2_ = 0

씨앗_

int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::seed_ = 0

사금파리_

int64 tensorflow::ops::FixedUnigramCandidateSampler::Attrs::shard_ = 0

단어_

gtl::ArraySlice< float > tensorflow::ops::FixedUnigramCandidateSampler::Attrs::unigrams_ = {}

어휘 파일_

StringPiece tensorflow::ops::FixedUnigramCandidateSampler::Attrs::vocab_file_ = ""

공공 기능

왜곡

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Distortion(
  float x
)

이 왜곡은 단어 확률 분포를 왜곡하는 데 사용됩니다.

각 가중치는 먼저 왜곡 지수만큼 거듭제곱된 후 내부 단어 분포에 더해집니다. 결과적으로 왜곡 지수가 1.0이면 (어휘 파일에 정의된 대로) 규칙적인 단어 샘플링이 이루어지고, 왜곡 지수가 0.0이면 균일한 분포가 이루어집니다.

기본값은 1입니다.

예약된 ID 수

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::NumReservedIds(
  int64 x
)

선택적으로 사용자는 [0, ..., num_reserved_ids) 범위 내에 예약된 ID를 추가할 수 있습니다.

한 가지 사용 사례는 알 수 없는 특수 단어 토큰을 ID 0으로 사용하는 것입니다. 이러한 ID는 샘플링 확률이 0이 됩니다.

기본값은 0입니다.

넘샤드

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::NumShards(
  int64 x
)

샘플러는 원래 범위의 부분 집합에서 샘플링하여 병렬 처리를 통해 전체 계산 속도를 높이는 데 사용할 수 있습니다.

이 매개변수는 ('shard'와 함께) 전체 계산에 사용되는 파티션 수를 나타냅니다.

기본값은 1입니다.

씨앗

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Seed(
  int64 x
)

seed 또는 seed2 중 하나라도 0이 아닌 값으로 설정되면, 난수 생성기는 지정된 시드 값으로 초기화됩니다.

그렇지 않으면 무작위 시드를 사용하여 초기화됩니다.

기본값은 0입니다.

시드2

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Seed2(
  int64 x
)

시드 충돌을 방지하기 위해 두 번째 시드를 추가합니다.

기본값은 0입니다.

사금파리

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Shard(
  int64 x
)

샘플러는 원래 범위의 부분 집합에서 샘플링하여 병렬 처리를 통해 전체 계산 속도를 높이는 데 사용할 수 있습니다.

이 매개변수는 ('num_shards'와 함께) 파티셔닝이 사용될 때 샘플러 연산의 특정 파티션 번호를 나타냅니다.

기본값은 0입니다.

유니그램

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::Unigrams(
  const gtl::ArraySlice< float > & x
)

각 ID별로 순차적으로 나열된 단어 개수 또는 확률 목록입니다.

이 연산에는 vocab_file과 unigrams 중 정확히 하나만 전달되어야 합니다.

기본값은 []입니다.

어휘 파일

TF_MUST_USE_RESULT Attrs tensorflow::ops::FixedUnigramCandidateSampler::Attrs::VocabFile(
  StringPiece x
)

CSV 형식과 유사한 이 파일의 각 유효한 행은 유효한 단어 ID에 해당합니다.

ID는 num_reserved_ids부터 순차적으로 나열됩니다. 각 줄의 마지막 항목은 개수 또는 상대 확률에 해당하는 값이어야 합니다. vocab_file과 unigrams 중 정확히 하나만 이 연산에 전달해야 합니다.

기본값은 ""입니다.