最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

TensorFlow中權(quán)重的隨機(jī)初始化的方法

 更新時(shí)間:2018年02月11日 09:19:30   作者:松松的鞋帶兒  
本篇文章主要介紹了TensorFlow中權(quán)重的隨機(jī)初始化的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧

一開(kāi)始沒(méi)看懂stddev是什么參數(shù),找了一下,在tensorflow/python/ops里有random_ops,其中是這么寫(xiě)的:

def random_normal(shape, mean=0.0, stddev=1.0, dtype=types.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.
  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.
  dtype: The type of the output.
  seed: A Python integer. Used to create a random seed for the distribution.
   See
   [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
   for behavior.
  name: A name for the operation (optional).

 Returns:
  A tensor of the specified shape filled with random normal values.
 """

也就是按照正態(tài)分布初始化權(quán)重,mean是正態(tài)分布的平均值,stddev是正態(tài)分布的標(biāo)準(zhǔn)差(standard deviation),seed是作為分布的random seed(隨機(jī)種子,我百度了一下,跟什么偽隨機(jī)數(shù)發(fā)生器還有關(guān),就是產(chǎn)生隨機(jī)數(shù)的),在mnist/concolutional中seed賦值為66478,挺有意思,不知道是什么原理。

后面還有truncated_normal的定義:

def truncated_normal(shape, mean=0.0, stddev=1.0, dtype=types.float32,
           seed=None, name=None):
 """Outputs random values from a truncated normal distribution.

 The generated values follow a normal distribution with specified mean and
 standard deviation, except that values whose magnitude is more than 2 standard
 deviations from the mean are dropped and re-picked.

 Args:
  shape: A 1-D integer Tensor or Python array. The shape of the output tensor.
  mean: A 0-D Tensor or Python value of type `dtype`. The mean of the
   truncated normal distribution.
  stddev: A 0-D Tensor or Python value of type `dtype`. The standard deviation
   of the truncated normal distribution.
  dtype: The type of the output.
  seed: A Python integer. Used to create a random seed for the distribution.
   See
   [`set_random_seed`](../../api_docs/python/constant_op.md#set_random_seed)
   for behavior.
  name: A name for the operation (optional).

 Returns:
  A tensor of the specified shape filled with random truncated normal values.
 """

截?cái)嗾龖B(tài)分布,以前都沒(méi)聽(tīng)說(shuō)過(guò)。

TensorFlow還提供了平均分布等。

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • Django文件存儲(chǔ) 自己定制存儲(chǔ)系統(tǒng)解析

    Django文件存儲(chǔ) 自己定制存儲(chǔ)系統(tǒng)解析

    這篇文章主要介紹了Django文件存儲(chǔ) 自己定制存儲(chǔ)系統(tǒng)解析,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2019-08-08
  • python調(diào)用golang中函數(shù)方法

    python調(diào)用golang中函數(shù)方法

    由于simhash方法有多種實(shí)現(xiàn)方式,現(xiàn)python中simhash方法與golang中的不一樣,需要兩者代碼生成結(jié)果保持一致,故采用python中的代碼調(diào)用golang編譯的so文件來(lái)實(shí)現(xiàn),需要的朋友可以參考下
    2024-02-02
  • 在Debian下配置Python+Django+Nginx+uWSGI+MySQL的教程

    在Debian下配置Python+Django+Nginx+uWSGI+MySQL的教程

    這篇文章主要介紹了在Debian下配置Python+Django+Nginx+uWSGI+MySQL的教程,Debian系統(tǒng)和Nginx服務(wù)器皆是高性能的選擇,需要的朋友可以參考下
    2015-04-04
  • 分享2個(gè)方便調(diào)試Python代碼的實(shí)用工具

    分享2個(gè)方便調(diào)試Python代碼的實(shí)用工具

    這篇文章主要介紹了分享方便調(diào)試Python代碼的2個(gè)實(shí)用工具,可以方便展示我們調(diào)試代碼的中間狀態(tài),提升大家的編碼效率,詳細(xì)的介紹需要的小伙伴可以參考一下下面文章內(nèi)容
    2022-05-05
  • Python實(shí)現(xiàn)暴力破解有密碼的zip文件的方法

    Python實(shí)現(xiàn)暴力破解有密碼的zip文件的方法

    這篇文章主要介紹了Python實(shí)現(xiàn)暴力破解有密碼的zip文件的方法,本文通過(guò)實(shí)例代碼給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-03-03
  • Python:一行代碼,導(dǎo)入Python所有庫(kù)

    Python:一行代碼,導(dǎo)入Python所有庫(kù)

    在本篇內(nèi)容里小編給大家分享如何用一行代碼,導(dǎo)入Python所有庫(kù),有需要的朋友們可以學(xué)習(xí)下,希望能夠給你帶來(lái)幫助
    2021-10-10
  • Python實(shí)現(xiàn)非正太分布的異常值檢測(cè)方式

    Python實(shí)現(xiàn)非正太分布的異常值檢測(cè)方式

    今天小編就為大家分享一篇Python實(shí)現(xiàn)非正太分布的異常值檢測(cè)方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2019-12-12
  • 深入了解PyQt5中的圖形視圖框架

    深入了解PyQt5中的圖形視圖框架

    PyQt5中圖形視圖框架主要包含三個(gè)類(lèi):QGraphicsItem圖元類(lèi)、QGraphicsScene場(chǎng)景類(lèi)和QGraphicsView視圖類(lèi)。本文將通過(guò)示例詳細(xì)講解一下這三個(gè)類(lèi),感興趣的可以學(xué)習(xí)一下
    2022-03-03
  • TensorFlow 合并/連接數(shù)組的方法

    TensorFlow 合并/連接數(shù)組的方法

    今天小編就為大家分享一篇TensorFlow 合并/連接數(shù)組的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-07-07
  • numpy.random.shuffle打亂順序函數(shù)的實(shí)現(xiàn)

    numpy.random.shuffle打亂順序函數(shù)的實(shí)現(xiàn)

    這篇文章主要介紹了numpy.random.shuffle打亂順序函數(shù)的實(shí)現(xiàn),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2019-09-09

最新評(píng)論

南岸区| 鹤庆县| 宝兴县| 闵行区| 东莞市| 塘沽区| 漯河市| 望城县| 额尔古纳市| 呼图壁县| 莱西市| 旬阳县| 于都县| 金阳县| 宜章县| 邯郸县| 榆林市| 明水县| 灌南县| 淅川县| 闽清县| 晋江市| 专栏| 精河县| 永吉县| 土默特右旗| 曲沃县| 磐安县| 利津县| 鹿泉市| 鲁甸县| 江陵县| 南开区| 北流市| 雷山县| 专栏| 浪卡子县| 松江区| 齐齐哈尔市| 蓬莱市| 阳信县|