- 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
- Clojure Data Analysis Cookbook
- 面向STEM的mBlock智能機器人創新課程
- 大數據技術基礎
- 21天學通JavaScript
- WOW!Illustrator CS6完全自學寶典
- Dreamweaver 8中文版商業案例精粹
- Mastering D3.js
- Mastering Salesforce CRM Administration
- Hands-On Linux for Architects
- Python Data Science Essentials
- Mastering ServiceNow Scripting
- 從零開始學C++
- TensorFlow Deep Learning Projects
- 智能制造系統及關鍵使能技術