- TensorFlow 2.0 Quick Start Guide
- Tony Holdroyd
- 65字
- 2021-06-24 16:02:05
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)>
推薦閱讀
- Mastering Mesos
- Introduction to DevOps with Kubernetes
- 軟件架構(gòu)設(shè)計
- Linux Mint System Administrator’s Beginner's Guide
- 控制與決策系統(tǒng)仿真
- TestStand工業(yè)自動化測試管理(典藏版)
- 工業(yè)機器人運動仿真編程實踐:基于Android和OpenGL
- 網(wǎng)站前臺設(shè)計綜合實訓(xùn)
- Applied Data Visualization with R and ggplot2
- 計算機組網(wǎng)技術(shù)
- Hands-On Agile Software Development with JIRA
- 機器人手工制作
- Apache Spark Machine Learning Blueprints
- 深度剖析:硬盤固件級數(shù)據(jù)恢復(fù)
- 數(shù)字系統(tǒng)設(shè)計與Verilog HDL