tf.contrib.distributions.Multinomial.__init__(n, logits=None, p=None, validate_args=False, allow_nan_stats=True, name='Multinomial')
Initialize a batch of Multinomial distributions.
Args:
-
n: Non-negative floating point tensor with shape broadcastable to[N1,..., Nm]withm >= 0. Defines this as a batch ofN1 x ... x Nmdifferent Multinomial distributions. Its components should be equal to integer values. -
logits: Floating point tensor representing the log-odds of a positive event with shape broadcastable to[N1,..., Nm, k], m >= 0, and the same dtype asn. Defines this as a batch ofN1 x ... x Nmdifferentkclass Multinomial distributions. -
p: Positive floating point tensor with shape broadcastable to[N1,..., Nm, k]m >= 0and same dtype asn. Defines this as a batch ofN1 x ... x Nmdifferentkclass Multinomial distributions.p's components in the last portion of its shape should sum up to 1. -
validate_args:Boolean, defaultFalse. Whether to assert valid values for parametersnandp, andxinprobandlog_prob. IfFalse, correct behavior is not guaranteed. -
allow_nan_stats:Boolean, defaultTrue. IfFalse, raise an exception if a statistic (e.g. mean/mode/etc...) is undefined for any batch member. IfTrue, batch members with valid parameters leading to undefined statistics will return NaN for this statistic. name: The name to prefix Ops created by this distribution class.Examples:
# Define 1-batch of 2-class multinomial distribution, # also known as a Binomial distribution. dist = Multinomial(n=2., p=[.1, .9]) # Define a 2-batch of 3-class distributions. dist = Multinomial(n=[4., 5], p=[[.1, .3, .6], [.4, .05, .55]])
Please login to continue.