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

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)>
主站蜘蛛池模板: 林周县| 石泉县| 吉安市| 南阳市| 光泽县| 寻甸| 贵德县| 蒙山县| 阿巴嘎旗| 桃园县| 潢川县| 尉犁县| 来凤县| 博白县| 岗巴县| 四平市| 义马市| 沙雅县| 孝义市| 星子县| 昭通市| 屏东县| 饶阳县| 庐江县| 正阳县| 信宜市| 墨脱县| 红原县| 周宁县| 江北区| 霍城县| 疏勒县| 江口县| 酒泉市| 西宁市| 西宁市| 武汉市| 九寨沟县| 东丰县| 大方县| 广汉市|