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

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)>
主站蜘蛛池模板: 丰城市| 黑龙江省| 宁武县| 于田县| 石棉县| 和政县| 烟台市| 荆门市| 米林县| 洛川县| 郧西县| 富裕县| 阜宁县| 临澧县| 盐亭县| 永济市| 通化市| 廉江市| 南川市| 大田县| 桐柏县| 新晃| 鸡泽县| 大余县| 江孜县| 三穗县| 德惠市| 浦城县| 会宁县| 丹寨县| 吉隆县| 凤山市| 黄冈市| 泸州市| 烟台市| 永吉县| 通渭县| 瓮安县| 偃师市| 门头沟区| 岚皋县|