FixedUnigramCandidateSampler.Options
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Méthodes héritées
De la classe java.lang.Object booléen | est égal à (Objet arg0) |
Classe finale<?> | obtenirClasse () |
int | Code de hachage () |
vide final | notifier () |
vide final | notifierTous () |
Chaîne | àChaîne () |
vide final | attendre (long arg0, int arg1) |
vide final | attendez (long arg0) |
vide final | attendez () |
Méthodes publiques
Paramètres
Distorsion | La distorsion est utilisée pour fausser la distribution de probabilité de l'unigramme. Chaque poids est d'abord augmenté à la puissance de la distorsion avant de s'ajouter à la distribution interne de l'unigramme. En conséquence, distorsion = 1,0 donne un échantillonnage d'unigramme régulier (tel que défini par le fichier de vocabulaire) et distorsion = 0,0 donne une distribution uniforme. |
---|
Paramètres
numReservedIds | En option, certains identifiants réservés peuvent être ajoutés dans la plage [0, ..., num_reserved_ids) par les utilisateurs. Un cas d'utilisation est qu'un jeton de mot inconnu spécial est utilisé comme ID 0. Ces ID auront une probabilité d'échantillonnage de 0. |
---|
Paramètres
nombre de fragments | Un échantillonneur peut être utilisé pour échantillonner un sous-ensemble de la plage d'origine afin d'accélérer l'ensemble du calcul grâce au parallélisme. Ce paramètre (avec 'shard') indique le nombre de partitions utilisées dans le calcul global. |
---|
Paramètres
graine | Si seed ou seed2 sont définis comme étant différents de zéro, le générateur de nombres aléatoires est amorcé par la graine donnée. Sinon, il est ensemencé par une graine aléatoire. |
---|
Paramètres
graine2 | Une deuxième graine pour éviter la collision des graines. |
---|
Paramètres
tesson | Un échantillonneur peut être utilisé pour échantillonner un sous-ensemble de la plage d'origine afin d'accélérer l'ensemble du calcul grâce au parallélisme. Ce paramètre (avec 'num_shards') indique le numéro de partition particulier d'une opération d'échantillonnage, lorsque le partitionnement est utilisé. |
---|
Paramètres
unigrammes | Une liste de décomptes ou de probabilités d'unigrammes, un par ID dans un ordre séquentiel. Exactement l'un des vocabulaire_file et unigrammes doit être transmis à cette opération. |
---|
Paramètres
fichiervocab | Chaque ligne valide de ce fichier (qui doit avoir un format de type CSV) correspond à un identifiant de mot valide. Les identifiants sont classés dans un ordre séquentiel, en commençant par num_reserved_ids. La dernière entrée de chaque ligne devrait être une valeur correspondant au nombre ou à la probabilité relative. Exactement l'un des vocabulaire_file et unigrammes doit être transmis à cette opération. |
---|
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/26 (UTC).
[null,null,["Dernière mise à jour le 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|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|"]]