Revise docs of tf.random.truncated_normal.
PiperOrigin-RevId: 346826860 Change-Id: I4f1c41a9fcaafa63c698e141fb093abee5caeec4
This commit is contained in:
parent
4a227e9fc5
commit
aaca6c1290
@ -168,9 +168,17 @@ def truncated_normal(shape,
|
|||||||
name=None):
|
name=None):
|
||||||
"""Outputs random values from a truncated normal distribution.
|
"""Outputs random values from a truncated normal distribution.
|
||||||
|
|
||||||
The generated values follow a normal distribution with specified mean and
|
The values are drawn from a normal distribution with specified mean and
|
||||||
standard deviation, except that values whose magnitude is more than 2 standard
|
standard deviation, discarding and re-drawing any samples that are more than
|
||||||
deviations from the mean are dropped and re-picked.
|
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:
|
Args:
|
||||||
shape: A 1-D integer Tensor or Python array. The shape of the output tensor.
|
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.
|
truncated normal distribution.
|
||||||
stddev: A 0-D Tensor or Python value of type `dtype`. The standard deviation
|
stddev: A 0-D Tensor or Python value of type `dtype`. The standard deviation
|
||||||
of the normal distribution, before truncation.
|
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.
|
seed: A Python integer. Used to create a random seed for the distribution.
|
||||||
See
|
See `tf.random.set_seed` for more information.
|
||||||
`tf.random.set_seed`
|
|
||||||
for behavior.
|
|
||||||
name: A name for the operation (optional).
|
name: A name for the operation (optional).
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
|
Loading…
Reference in New Issue
Block a user