日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

TensorFlow学习笔记(十六)tf.random_normal

發(fā)布時(shí)間:2024/1/23 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 TensorFlow学习笔记(十六)tf.random_normal 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
W1 = tf.Variable(tf.random_normal([3, 3, 1, 32], stddev=0.01)),對(duì)于函數(shù) tf.random_normal解釋如下: tf.random_normal tf.random_normal(shape, mean=0.0, stddev=1.0, dtype=tf.float32, seed=None, name=None)
Outputs random values from a normal distribution.
Args:
shape: A 1-D integer Tensor or Python array. The shape of the output tensor.用一個(gè)list表示產(chǎn)出的Tensor的形狀 mean: A 0-D Tensor or Python value of type dtype. The mean of the normal distribution.均值 stddev: A 0-D Tensor or Python value of type dtype. The standard deviation of the normal distribution.標(biāo)準(zhǔn)差 dtype: The type of the output.數(shù)據(jù)類型 seed: A Python integer. Used to create a random seed for the distribution. See set_random_seed for behavior. name: A name for the operation (optional). Returns:
A tensor of the specified shape filled with random normal values.
例子:
import tensorflow as tf
import matplotlib.pyplot as plt

a = tf.random_normal([2,10],mean=0,stddev=1)
sess = tf.Session()
out = sess.run(a)
print(out)
x, y = out
print(x)
print(y)
plt.scatter(x,y)
plt.show()
sess.close()

結(jié)果:
[[ 0.83045179 -0.57167524 -1.86910343 ...,? 0.71390063? 1.04222453
?? 0.91866982]
?[ 1.00804222 -0.4957338?? 0.63204587 ..., -0.69086301? 0.71216989? 0.02643?? ]]
[ 0.83045179 -0.57167524 -1.86910343? 0.44209865 -1.05302727? 0.64135087
? 1.89882576? 0.71390063? 1.04222453? 0.91866982]
[ 1.00804222 -0.4957338?? 0.63204587 -0.55980664? 0.56179941? 0.27138013
? 0.26539552 -0.69086301? 0.71216989? 0.02643?? ]

總結(jié)

以上是生活随笔為你收集整理的TensorFlow学习笔记(十六)tf.random_normal的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。