tf.contrib.distributions.DirichletMultinomial.__init__(n, alpha, validate_args=False, allow_nan_stats=True, name='DirichletMultinomial')
Initialize a batch of DirichletMultinomial distributions.
Args:
-
n
: Non-negative floating point tensor, whose dtype is the same asalpha
. The shape is broadcastable to[N1,..., Nm]
withm >= 0
. Defines this as a batch ofN1 x ... x Nm
different Dirichlet multinomial distributions. Its components should be equal to integer values. -
alpha
: Positive floating point tensor, whose dtype is the same asn
with shape broadcastable to[N1,..., Nm, k]
m >= 0
. Defines this as a batch ofN1 x ... x Nm
differentk
class Dirichlet multinomial distributions. -
validate_args
:Boolean
, defaultFalse
. Whether to assert valid values for parametersalpha
andn
, andx
inprob
andlog_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 Dirichlet multinomial distribution, # also known as a beta-binomial. dist = DirichletMultinomial(2.0, [1.1, 2.0]) # Define a 2-batch of 3-class distributions. dist = DirichletMultinomial([3., 4], [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]])
Please login to continue.