FixedUnigramCandidateSampler.Options
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Phương pháp kế thừa
Từ lớp java.lang.Object boolean | bằng (Đối tượng arg0) |
Lớp cuối cùng<?> | getClass () |
int | Mã Băm () |
khoảng trống cuối cùng | thông báo () |
khoảng trống cuối cùng | thông báoTất cả () |
Sợi dây | toString () |
khoảng trống cuối cùng | chờ đã (arg0 dài, int arg1) |
khoảng trống cuối cùng | chờ đã (arg0 dài) |
khoảng trống cuối cùng | Chờ đợi () |
Phương pháp công khai
Thông số
méo mó | Sự biến dạng được sử dụng để làm lệch phân bố xác suất unigram. Mỗi trọng số trước tiên được nâng lên tới mức độ biến dạng trước khi thêm vào phân phối unigram bên trong. Kết quả là, độ méo = 1,0 cho phép lấy mẫu unigram thông thường (như được xác định bởi tệp từ vựng) và độ méo = 0,0 mang lại sự phân bố đồng đều. |
---|
Thông số
numReservedId | Người dùng có thể tùy chọn thêm một số ID dành riêng trong phạm vi [0, ..., num_reserved_ids). Một trường hợp sử dụng là mã thông báo từ đặc biệt không xác định được sử dụng làm ID 0. Các ID này sẽ có xác suất lấy mẫu là 0. |
---|
Thông số
số mảnh vỡ | Một bộ lấy mẫu có thể được sử dụng để lấy mẫu từ một tập hợp con của phạm vi ban đầu nhằm tăng tốc toàn bộ quá trình tính toán thông qua tính song song. Tham số này (cùng với 'phân đoạn') cho biết số lượng phân vùng đang được sử dụng trong quá trình tính toán tổng thể. |
---|
Thông số
hạt giống | Nếu hạt giống hoặc hạt giống2 được đặt khác 0, thì bộ tạo số ngẫu nhiên sẽ được gieo hạt giống đã cho. Nếu không, nó sẽ được gieo bởi một hạt giống ngẫu nhiên. |
---|
Thông số
hạt giống2 | Hạt giống thứ hai để tránh va chạm hạt giống. |
---|
Thông số
mảnh vỡ | Một bộ lấy mẫu có thể được sử dụng để lấy mẫu từ một tập hợp con của phạm vi ban đầu nhằm tăng tốc toàn bộ quá trình tính toán thông qua tính song song. Tham số này (cùng với 'num_shards') cho biết số phân vùng cụ thể của hoạt động lấy mẫu khi phân vùng đang được sử dụng. |
---|
Thông số
unigram | Danh sách số lượng hoặc xác suất unigram, mỗi số một ID theo thứ tự tuần tự. Chính xác một trong số vocab_file và unigram sẽ được chuyển cho op này. |
---|
Thông số
tập tin từ vựng | Mỗi dòng hợp lệ trong tệp này (phải có định dạng giống CSV) tương ứng với một ID từ hợp lệ. ID được sắp xếp theo thứ tự, bắt đầu từ num_reserved_ids. Mục cuối cùng trong mỗi dòng dự kiến sẽ là một giá trị tương ứng với số lượng hoặc xác suất tương đối. Chính xác một trong số vocab_file và unigram cần được chuyển tới op này. |
---|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],null,["# FixedUnigramCandidateSampler.Options\n\npublic static class **FixedUnigramCandidateSampler.Options** \nOptional attributes for [FixedUnigramCandidateSampler](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler) \n\n### Public Methods\n\n|----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [distortion](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#distortion(java.lang.Float))(Float distortion) |\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [numReservedIds](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#numReservedIds(java.lang.Long))(Long numReservedIds) |\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [numShards](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#numShards(java.lang.Long))(Long numShards) |\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [seed](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#seed(java.lang.Long))(Long seed) |\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [seed2](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#seed2(java.lang.Long))(Long seed2) |\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [shard](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#shard(java.lang.Long))(Long shard) |\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [unigrams](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#unigrams(java.util.List\u003cjava.lang.Float\u003e))(List\\\u003cFloat\\\u003e unigrams) |\n| [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options) | [vocabFile](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options#vocabFile(java.lang.String))(String vocabFile) |\n\n### Inherited Methods\n\nFrom class java.lang.Object \n\n|------------------|---------------------------|\n| boolean | equals(Object arg0) |\n| final Class\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| String | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nPublic Methods\n--------------\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**distortion**\n(Float distortion)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| distortion | The distortion is used to skew the unigram probability distribution. Each weight is first raised to the distortion's power before adding to the internal unigram distribution. As a result, distortion = 1.0 gives regular unigram sampling (as defined by the vocab file), and distortion = 0.0 gives a uniform distribution. |\n|------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**numReservedIds**\n(Long numReservedIds)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| numReservedIds | Optionally some reserved IDs can be added in the range \\[0, ..., num_reserved_ids) by the users. One use case is that a special unknown word token is used as ID 0. These IDs will have a sampling probability of 0. |\n|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**numShards**\n(Long numShards)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| numShards | A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. This parameter (together with 'shard') indicates the number of partitions that are being used in the overall computation. |\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**seed**\n(Long seed)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| seed | If either seed or seed2 are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed. |\n|------|----------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**seed2**\n(Long seed2)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| seed2 | An second seed to avoid seed collision. |\n|-------|-----------------------------------------|\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**shard**\n(Long shard)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| shard | A sampler can be used to sample from a subset of the original range in order to speed up the whole computation through parallelism. This parameter (together with 'num_shards') indicates the particular partition number of a sampler op, when partitioning is being used. |\n|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**unigrams**\n(List\\\u003cFloat\\\u003e unigrams)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| unigrams | A list of unigram counts or probabilities, one per ID in sequential order. Exactly one of vocab_file and unigrams should be passed to this op. |\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------|\n\n#### public [FixedUnigramCandidateSampler.Options](/jvm/api_docs/java/org/tensorflow/op/nn/FixedUnigramCandidateSampler.Options)\n**vocabFile**\n(String vocabFile)\n\n\u003cbr /\u003e\n\n##### Parameters\n\n| vocabFile | Each valid line in this file (which should have a CSV-like format) corresponds to a valid word ID. IDs are in sequential order, starting from num_reserved_ids. The last entry in each line is expected to be a value corresponding to the count or relative probability. Exactly one of vocab_file and unigrams needs to be passed to this op. |\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|"]]