FixedUnigramCandidateSampler.Options
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
วิธีการสืบทอด
จากคลาส java.lang.Object บูลีน | เท่ากับ (วัตถุ arg0) |
คลาสสุดท้าย<?> | รับคลาส () |
ภายใน | แฮชโค้ด () |
โมฆะสุดท้าย | แจ้ง () |
โมฆะสุดท้าย | แจ้งทั้งหมด () |
สตริง | toString () |
โมฆะสุดท้าย | รอสักครู่ (ยาว arg0, int arg1) |
โมฆะสุดท้าย | รอ (ยาว arg0) |
โมฆะสุดท้าย | รอ () |
วิธีการสาธารณะ
สาธารณะ คงการบิดเบือน UnigramCandidateSampler.Options (ความผิดเพี้ยนแบบลอย)
พารามิเตอร์
การบิดเบือน | การบิดเบือนจะใช้เพื่อบิดเบือนการแจกแจงความน่าจะเป็นแบบยูนิแกรม ตุ้มน้ำหนักแต่ละอันจะถูกยกขึ้นตามกำลังของการบิดเบือนก่อนจึงจะเพิ่มไปยังการแจกแจงแบบยูนิแกรมภายใน ผลก็คือ ความบิดเบี้ยว = 1.0 ให้การสุ่มตัวอย่างแบบยูนิแกรมปกติ (ตามที่กำหนดโดยไฟล์คำศัพท์) และการบิดเบือน = 0.0 ให้การแจกแจงแบบสม่ำเสมอ |
---|
พารามิเตอร์
numReservedIds | นอกจากนี้ ผู้ใช้ยังสามารถเพิ่ม ID ที่สงวนไว้บางส่วนในช่วง [0, ..., num_reserved_ids) ได้ กรณีการใช้งานประการหนึ่งคือมีการใช้โทเค็นคำพิเศษที่ไม่รู้จักเป็น ID 0 รหัสเหล่านี้จะมีความน่าจะเป็นในการสุ่มตัวอย่างเป็น 0 |
---|
พารามิเตอร์
numShards | เครื่องเก็บตัวอย่างสามารถใช้เพื่อสุ่มตัวอย่างจากชุดย่อยของช่วงดั้งเดิมเพื่อเร่งความเร็วการคำนวณทั้งหมดผ่านการขนาน พารามิเตอร์นี้ (ร่วมกับ 'shard') ระบุจำนวนพาร์ติชันที่ใช้ในการคำนวณโดยรวม |
---|
พารามิเตอร์
เมล็ดพันธุ์ | หากเมล็ดพืชหรือเมล็ดพืช2 ถูกตั้งค่าไม่เป็นศูนย์ เครื่องกำเนิดตัวเลขสุ่มจะถูกเพาะโดยเมล็ดที่ให้มา มิฉะนั้นจะถูกเพาะโดยเมล็ดแบบสุ่ม |
---|
พารามิเตอร์
เมล็ดพันธุ์2 | เมล็ดที่สองเพื่อหลีกเลี่ยงการชนกันของเมล็ด |
---|
พารามิเตอร์
เศษ | เครื่องเก็บตัวอย่างสามารถใช้เพื่อสุ่มตัวอย่างจากชุดย่อยของช่วงดั้งเดิมเพื่อเร่งความเร็วการคำนวณทั้งหมดผ่านการขนาน พารามิเตอร์นี้ (ร่วมกับ 'num_shards') ระบุหมายเลขพาร์ติชันเฉพาะของแซมเพลอร์ op เมื่อใช้การแบ่งพาร์ติชัน |
---|
พารามิเตอร์
ยูนิแกรม | รายการจำนวนยูนิแกรมหรือความน่าจะเป็น หนึ่งรายการต่อ ID ตามลำดับ ควรส่ง vocab_file และ unigrams หนึ่งรายการไปยัง op นี้ |
---|
พารามิเตอร์
vocabFile | แต่ละบรรทัดที่ถูกต้องในไฟล์นี้ (ซึ่งควรมีรูปแบบคล้าย CSV) สอดคล้องกับรหัสคำที่ถูกต้อง รหัสจะเรียงลำดับตามลำดับ โดยเริ่มจาก num_reserved_ids รายการสุดท้ายในแต่ละบรรทัดคาดว่าจะเป็นค่าที่สอดคล้องกับการนับหรือความน่าจะเป็นแบบสัมพันธ์ ต้องส่ง vocab_file และ unigrams หนึ่งรายการไปยัง op นี้ |
---|
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 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|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|"]]