FixedUnigramCandidateSampler.Options
Stay organized with collections
Save and categorize content based on your preferences.
Inherited Methods
From class
java.lang.Object
boolean
|
equals(Object arg0)
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
Public Methods
Parameters
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.
|
Parameters
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.
|
Parameters
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.
|
Parameters
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.
|
Parameters
seed2 |
An second seed to avoid seed collision.
|
Parameters
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.
|
Parameters
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.
|
Parameters
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2021-11-29 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2021-11-29 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|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|"]]