tf.contrib.distributions.Uniform.__init__(a=0.0, b=1.0, validate_args=False, allow_nan_stats=True, name='Uniform')
Construct Uniform distributions with a
and b
.
The parameters a
and b
must be shaped in a way that supports broadcasting (e.g. b - a
is a valid operation).
Here are examples without broadcasting:
# Without broadcasting u1 = Uniform(3.0, 4.0) # a single uniform distribution [3, 4] u2 = Uniform([1.0, 2.0], [3.0, 4.0]) # 2 distributions [1, 3], [2, 4] u3 = Uniform([[1.0, 2.0], [3.0, 4.0]], [[1.5, 2.5], [3.5, 4.5]]) # 4 distributions
And with broadcasting:
u1 = Uniform(3.0, [5.0, 6.0, 7.0]) # 3 distributions
Args:
-
a
: Floating point tensor, the minimum endpoint. -
b
: Floating point tensor, the maximum endpoint. Must be >a
. -
validate_args
:Boolean
, defaultFalse
. Whether to validate input with asserts. Ifvalidate_args
isFalse
, and the 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.
Raises:
-
InvalidArgumentError
: ifa >= b
andvalidate_args=False
.
Please login to continue.