Tensorflow truncated_normal API

来源:互联网 发布:sql联合主键查询 编辑:程序博客网 时间:2024/06/06 07:31

tf.truncated_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, 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.
生成的值会遵循一个指定了平均值和标准差的正态分布,只保留两个标准差以内的值,超出的值会被弃掉重新生成。

Args:
shape: A 1-D integer Tensor or Python array. The shape of the output tensor.
mean: A 0-D Tensor or Python value of typedtype. The mean of the truncated normal distribution.
stddev: A 0-D Tensor or Python value of typedtype. The standard deviation of the truncated normal distribution.
dtype: The type of the output.
seed: A Python integer. Used to create a random seed for the distribution. Seeset_random_seed for behavior.
name: A name for the operation (optional).
参数:
shape: 一个一维整数张量 或 一个Python数组。 这个值决定输出张量的形状。
mean: 一个零维张量或 类型属于dtype的Python值. 这个值决定正态分布片段的平均值
stddev: 一个零维张量或 类型属于dtype的Python值. 这个值决定正态分布片段的标准差。
dtype: 输出的类型.
seed: 一个Python整数. 被用来为正态分布创建一个随机种子. 详情可见set_random_seed for behavior.
name: 操作的名字 (可选参数).

Returns:
A tensor of the specified shape filled with random truncated normal values.
一个指定形状并用正态分布片段的随机值填充的张量