官术网_书友最值得收藏!

Using tf.random.normal()

tf.random.normal() outputs a tensor of the given shape filled with values of the dtype type from a normal distribution.

The required signature is as follows:

tf. random.normal(shape, mean = 0, stddev =2, dtype=tf.float32, seed=None, name=None)

Take this, for example:

tf.random.normal(shape = (3,2), mean=10, stddev=2, dtype=tf.float32, seed=None,  name=None)
ran = tf.random.normal(shape = (3,2), mean=10.0, stddev=2.0)
print(ran)

The output will be as follows:

<tf.Tensor: id=13, shape=(3, 2), dtype=float32, numpy= array([[ 8.537131 , 7.6625767], [10.925293 , 11.804686 ], [ 9.3763075, 6.701221 ]], dtype=float32)>
主站蜘蛛池模板: 友谊县| 锦州市| 长岭县| 满洲里市| 文水县| 安多县| 望都县| 普兰县| 海兴县| 青岛市| 鄱阳县| 平果县| 南投市| 道真| 柳河县| 敦化市| 临澧县| 鹤山市| 中牟县| 灵璧县| 青阳县| 巨鹿县| 青海省| 吴堡县| 铜梁县| 昌乐县| 榆社县| 洛南县| 苗栗县| 新干县| 大城县| 通州区| 珲春市| 平谷区| 盐池县| 贡觉县| 鄂尔多斯市| 乐陵市| 博乐市| 南平市| 金溪县|