tf.contrib.distributions.Binomial.__init__(n, logits=None, p=None, validate_args=False, allow_nan_stats=True, name='Binomial')
Initialize a batch of Binomial distributions.
Args:
-
n
: Non-negative floating point tensor with shape broadcastable to[N1,..., Nm]
withm >= 0
and the same dtype asp
orlogits
. Defines this as a batch ofN1 x ... x Nm
different Binomial 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]
m >= 0
, and the same dtype asn
. Each entry represents logits for the probability of success for independent Binomial distributions. -
p
: Positive floating point tensor with shape broadcastable to[N1,..., Nm]
m >= 0
,p in [0, 1]
. Each entry represents the probability of success for independent Binomial distributions. -
validate_args
:Boolean
, defaultFalse
. Whether to assert valid values for parametersn
,p
, andx
inprob
andlog_prob
. IfFalse
and inputs are invalid, 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 a binomial distribution. dist = Binomial(n=2., p=.9) # Define a 2-batch. dist = Binomial(n=[4., 5], p=[.1, .3])
Please login to continue.