tf.compat.v1.multinomial Stay organized with collections Save and categorize content based on your preferences.
Draws samples from a multinomial distribution. (deprecated)
tf . compat . v1 . multinomial ( logits , num_samples , seed = None , name = None , output_dtype = None )
Deprecated: THIS FUNCTION IS DEPRECATED. It will be removed in a future version. Instructions for updating: Use tf.random.categorical
instead. Example:
# samples has shape [1, 5], where each value is either 0 or 1 with equal # probability. samples = tf . random . categorical ( tf . math . log ([[ 0.5 , 0.5 ]]), 5 )
Args
logits
2-D Tensor with shape [batch_size, num_classes]
. Each slice [i, :]
represents the unnormalized log-probabilities for all classes. num_samples
0-D. Number of independent samples to draw for each row slice. seed
A Python integer. Used to create a random seed for the distribution. See tf.random.set_seed
for behavior. name
Optional name for the operation. output_dtype
The integer type of the output: int32
or int64
. Defaults to int64
.
Returns The drawn samples of shape [batch_size, num_samples]
.
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. Some content is licensed under the numpy license .
Last updated 2024-04-26 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 2024-04-26 UTC."],[],[]]