Revise docs of tf.random.truncated_normal.

PiperOrigin-RevId: 346826860
Change-Id: I4f1c41a9fcaafa63c698e141fb093abee5caeec4
This commit is contained in:
Dan Moldovan 2020-12-10 11:26:07 -08:00 committed by TensorFlower Gardener
parent 4a227e9fc5
commit aaca6c1290

View File

@ -168,9 +168,17 @@ def truncated_normal(shape,
name=None):
"""Outputs random values from a truncated normal distribution.
The generated values follow a normal distribution with specified mean and
standard deviation, except that values whose magnitude is more than 2 standard
deviations from the mean are dropped and re-picked.
The values are drawn from a normal distribution with specified mean and
standard deviation, discarding and re-drawing any samples that are more than
two standard deviations from the mean.
Examples:
>>> tf.random.truncated_normal(shape=[2])
<tf.Tensor: shape=(2,), dtype=float32, numpy=array([..., ...], dtype=float32)>
>>> tf.random.truncated_normal(shape=[2], mean=3, stddev=1, dtype=tf.float32)
<tf.Tensor: shape=(2,), dtype=float32, numpy=array([..., ...], dtype=float32)>
Args:
shape: A 1-D integer Tensor or Python array. The shape of the output tensor.
@ -178,11 +186,10 @@ def truncated_normal(shape,
truncated normal distribution.
stddev: A 0-D Tensor or Python value of type `dtype`. The standard deviation
of the normal distribution, before truncation.
dtype: The type of the output.
dtype: The type of the output. Restricted to floating-point types:
`tf.half`, `tf.float`, `tf.double`, etc.
seed: A Python integer. Used to create a random seed for the distribution.
See
`tf.random.set_seed`
for behavior.
See `tf.random.set_seed` for more information.
name: A name for the operation (optional).
Returns: