TensorFlow学习笔记:tf.random_normal

该函数接受三个参数,分别是:

tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)

输出的数据呢,是服从标准正态分布的,shape是数据的形状(m*n的矩阵),dtype是其类型。

这里的用法和np.random.normal(loc=0.0scale=1.0size=None)略像,

loc:Mean (“centre”) of the distribution

scale:Standard deviation (spread or “width”) of the distribution.

size : Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. If size is None (default), a single value is returned if loc and scale are both scalars. Otherwise, np.broadcast(loc, scale).size samples are drawn.

猜你喜欢

转载自blog.csdn.net/dengdengma520/article/details/79157733