《前饋神經網絡》嘅修訂比較
內容刪咗 內容加咗
m zap1 |
m zap1 |
||
第1行:
[[File:Colored neural network.svg|thumb|300px|一個前饋人工神經網絡嘅抽象圖;每個圓圈代表一粒[[人工神經細胞|神經細胞]],每粒神經細胞嘅啟動程度淨係受佢打前嗰排神經細胞嘅啟動程度影響<ref>"[https://www.frontiersin.org/research-topics/4817/artificial-neural-networks-as-models-of-neural-information-processing Artificial Neural Networks as Models of Neural Information Processing | Frontiers Research Topic]". Retrieved 2018-02-20.</ref>。]]
'''前饋神經網絡'''({{jpingauto|cin4 gwai3 san4 ging1 mong5 lok6}};
:<math>t = W_1 A_1 + W_2 A_2...</math>;([[啟動函數]])
第6行:
喺呢條式當中,<math>t</math> 代表嗰粒神經細胞嘅啟動程度,<math>A_n</math> 代表前一排嘅神經細胞當中第 <math>n</math> 粒嘅啟動程度,而 <math>W_n</math> 就係其他神經細胞當中第 <math>n</math> 粒嘅權重(指嗰粒神經細胞有幾影響到 <math>t</math>)。<math>A_n</math> 當中唔包括任何前排以外嘅細胞,令成個網絡嘅[[訊號]]'''只會以一個方向傳遞'''-呢一點令前饋神經網絡好唔似[[生物神經網絡]],亦都係前饋網絡同[[遞迴神經網絡]](recurrent neural network)嘅主要差異<ref name="diff">[https://towardsdatascience.com/the-differences-between-artificial-and-biological-neural-networks-a8b46db828b7 The differences between Artificial and Biological Neural Networks]. ''Towards Data Science''.</ref>。
雖然係噉,事實說明咗前饋神經網絡能夠輕易處理'''非連串性'''(non-sequential;一串[[文字]]就有連串性-前面嘅[[資訊]]會影響後面嘅資訊嘅意思)而且'''唔視乎時間''
== 單層感知機 ==
第29行:
:<math>\text{output} = g(\overrightarrow{w} \cdot \overrightarrow{x} + b)</math>;<math>[1]</math>
當中 <math>\overrightarrow{x}</math> 係代表柞輸入嘅[[向量]];<math>\overrightarrow{w}</math> 係代表柞權重嘅向量;而 <math>b</math> 代表'''偏向'''(bias),即係嗰粒神經細胞本身喺啟動上嘅傾向,例如如果有某一粒人工神經細胞嘅 <math>b</math> 係正數而且數值大,佢就會傾向無論輸入係幾多都有強烈嘅啟動。用嘅係[[監督式學習]],個學習演算法要做嘅嘢就係按讀取到嘅數值調整柞 <math>w</math>,等個網絡將來會更加有能力俾到準確嘅輸出<ref name="auer2008"/>。
;例子碼
例如以下呢段用 [[Python 程式語言]]寫嘅[[源碼]]定義咗一個簡單嘅感知機神經網絡<ref group="註">呢部感知機未有機制改變權重,所以唔會識學習。</ref><ref name="firstneural">[https://towardsdatascience.com/first-neural-network-for-beginners-explained-with-code-4cfd37e06eaf First neural network for beginners explained (with code)]. ''Towards Data Science''.</ref>:
第70行:
;第二步:更新權重值
#每一個權重值,佢都會由條式嗰度有一個'''梯度值'''(gradient);
#每一個權重值嘅改變幅度等如個梯度值乘以 <math>\eta</math>-如果 <math>\eta</math> 係 0,噉個神經網絡永遠都唔會變,而如果 <math>\eta</math> 數值大,噉個神經網絡會變化得好快,所以 <math>\eta</math> 掌管咗個神經網絡學習有幾快;
#將邇柞值「反向傳播」返去個神經網絡嗰度,將每個權重值變成佢嘅新數值(實際更新 <math>w_{ij}</math> 值);
第78行:
=== 局限 ===
[[單層感知機]](single-layer perceptron;冇隱藏層嘅感知機)嘅局限在於佢係線性嘅分類機。單層感知機嘅感知機只能夠學識作出線性嘅分類,即係例如按兩個變數 <math>x</math> 同 <math>y</math> 將一柞個案分類,一個分類機會畫一條線,而條線係 <math>x</math> 同 <math>y</math> 嘅函數(例:<math>y = 2x + 5</math>),如果呢條線能夠正確噉分開兩類個案,條線就係一部成功嘅
{{clear}}
[[File:Kernel Machine.svg|510px|center]]
第86行:
== 多層感知機 ==
{{main|多層感知機}}
[[多層感知機]](multi-layer perceptron,MLP)係一個包含多部感知機嘅人工神經網絡:多層感知機有'''隱藏層'''(hidden layer),即係唔會直接收外界輸入又唔會直接向外界俾輸出嘅神經細胞層;同單層感知機唔同嘅係,多層感知機能夠處理非線性嘅關係,喺好多人工神經網絡應用上都有價值<ref>Pal, S. K., & Mitra, S. (1992). ''Multilayer perceptron, fuzzy sets, classifiaction''.</ref>。一部三層(有一浸隱藏層)嘅感知機可以想像成以下噉嘅樣<ref name="sch"/>:
{{clear}}
[[File:Artificial neural network.svg|360px|center]]
第93行:
定義上,多層感知機具有以下嘅特徵<ref name="sch"/>:
*每粒第 <math>i</math> 層嘅神經細胞都同第 <math>i-1</math> 層嘅神經細胞有連繫,即係話每粒第 <math>i-1</math> 層嘅神經細胞都有能力影響第 <math>i</math> 層嘅神經細胞嘅啟動程度,即係每層之間都'''完全連繫''
*第 <math>i</math> 層嘅神經細胞唔會受第 <math>j</math> 層嘅神經細胞影響,當中 <math>j</math> 係任何一個大過 <math>i</math> 嘅整數;
*同一層嘅神經細胞之間冇連繫。
=== 反向傳播算法 ===
{{main|反向傳播算法}}
[[反向傳播算法]](backpropagation)係 [[delta 法則]](睇上面)嘅廣義化:喺得到誤差函數之後,就可以計柞 <math>w</math> 要點調整<ref>Nielsen, Michael A. (2015). "Chapter 6". ''Neural Networks and Deep Learning''.</ref><ref>Kelley, Henry J. (1960). "Gradient theory of optimal flight paths". ''ARS Journal''. 30 (10): 947–954.</ref>,例如
:<math>w_{ij}(t + 1) = w_{ij}(t) + \eta\frac{\partial E(X)}{\partial w_{ij}} +\xi(t) </math>;<math>[5]</math> 當中
第106行:
*<math>E(X)</math> 係個誤差,反映咗喺個個案入面個神經網絡俾嘅輸出同正確輸出差幾遠;
*<math>\frac{\partial E(X)}{\partial w_{ij}}</math> 係 <math>E(X)</math> 隨住 <math>w_{ij}</math> 嘅[[偏導數]](partial derivative);
*<math>\xi(t) </math> 係一個
如果一個以電腦程式寫嘅神經網絡跟呢條式(或者係類似嘅式)嚟行嘅話,佢喺計完每一個個案之後,都會計出佢裏面嘅權重值要點樣改變,並且將呢個「每個權重應該要點變」嘅資訊傳返去個網絡嗰度(所以就叫「反向傳播」)。而每次有個權重值改變嗰陣,佢嘅改變幅度會同「誤差值」有一定嘅關係,而且佢對計個輸出嘅參與愈大,佢嘅改變幅度會愈大<ref>Dreyfus, Stuart (1973). "The computational solution of optimal control problems with time lag". ''IEEE Transactions on Automatic Control''. 18 (4): 383–385.</ref>-個神經網絡會一路計個案一路變,變到誤差值愈嚟愈接近零為止<ref>Dreyfus, Stuart E. (1990-09-01). "Artificial neural networks, back propagation, and the Kelley-Bryson gradient procedure". ''Journal of Guidance, Control, and Dynamics''. 13 (5): 926–928. </ref>。而除咗確率勾配降下法之外,反向傳播仲有好多其他方法做,詳情可以睇[[最佳化]](optimization)相關嘅課題<ref>Huang, Guang-Bin; Zhu, Qin-Yu; Siew, Chee-Kheong (2006). "Extreme learning machine: theory and applications". ''Neurocomputing''. 70 (1): 489–501.</ref><ref>Widrow, Bernard; et al. (2013). "The no-prop algorithm: A new learning algorithm for multilayer neural networks". ''Neural Networks''. 37: 182–188.</ref>。
|