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.
從一個正態(tài)分布片段中輸出隨機(jī)數(shù)值
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.
生成的值會遵循一個指定了平均值和標(biāo)準(zhǔn)差的正態(tài)分布啸胧,只保留兩個標(biāo)準(zhǔn)差以內(nèi)的值勋磕,超出的值會被棄掉重新生成。
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).
參數(shù):
shape: 一個一維整數(shù)張量 或 一個Python數(shù)組。 這個值決定輸出張量的形狀秽荤。
mean: 一個零維張量或 類型屬于dtype的Python值. 這個值決定正態(tài)分布片段的平均值
stddev: 一個零維張量或 類型屬于dtype的Python值. 這個值決定正態(tài)分布片段的標(biāo)準(zhǔn)差。
dtype: 輸出的類型.
seed: 一個Python整數(shù). 被用來為正態(tài)分布創(chuàng)建一個隨機(jī)種子. 詳情可見set_random_seed
for behavior.
name: 操作的名字 (可選參數(shù)).
Returns:
A tensor of the specified shape filled with random truncated normal values.
一個指定形狀并用正態(tài)分布片段的隨機(jī)值填充的張量
感謝 梓曉宇 提供的錯誤修正 > <