《前饋神經網絡》嘅修訂比較
內容刪咗 內容加咗
m →睇埋 |
m zap1 |
||
(無顯示另外2個用戶中途改嘅13版) | |||
第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>。]]
{{ruby-yue|'''前饋神經網絡'''
:<math>t = W_1 A_1 + W_2 A_2...</math>;([[啟動函數]])
喺呢條式當中,<math>t</math> 代表嗰粒神經細胞嘅啟動程度,<math>A_n</math> 代表前一排嘅神經細胞當中第 <math>n</math> 粒嘅啟動程度,而 <math>W_n</math> 就係其他神經細胞當中第 <math>n</math> 粒嘅權重(指嗰粒神經細胞有幾影響到 <math>t</math>)。<math>A_n</math> 當中唔包括任何前排以外嘅細胞,令成個網絡嘅[[訊號]]'''只會以一個方向傳遞'''-呢一點令前饋神經網絡好唔似[[生物神經網絡]],亦都係前饋網絡同[[遞迴神經網絡]]
雖然係噉,事實說明咗前饋神經網絡能夠輕易處理'''非連串性'''(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)]
<source lang="python">
第43行:
{{clear}}
=== 誤差函數 ===
{{see also|損失函數}}
要教部感知機學習,通常第一步係要界定一個[[誤差函數]](error function)。學習[[定義]]上係指按照經驗改變自己嘅行為,所以一個認知系統要學習,其中一個最直接嘅做法係睇吓自己做嘅預測同實際經驗到嘅有幾大差異,誤差函數係指一個表達[[誤差]](error)由邊啲變數同常數話事嘅[[函數]](function),例如以下呢個就係一個常用嘅誤差函數<ref name="haykin2009">Haykin, S. S., Haykin, S. S., Haykin, S. S., Elektroingenieur, K., & Haykin, S. S. (2009). ''Neural networks and learning machines'' (Vol. 3). Upper Saddle River: Pearson education.</ref><ref>Jain, A. K., Mao, J., & Mohiuddin, K. M. (1996). Artificial neural networks: A tutorial. ''Computer'', (3), 31-44.</ref>:
第48行 ⟶ 第49行:
:<math>E(X) = \frac{1}{N}\sum_{i=1}^N(g(\overrightarrow{w} \cdot \overrightarrow{x} + b) - y_i)^2</math>;<math>[3]</math>(代咗 <math>[1]</math> 入去 <math>[2]</math> 嗰度)
呢條式當中嘅 <math>E(X)</math> 反映咗個總誤差:<math>(\text{output}_i - y_i)^2</math> 表示第 <math>i</math> 個預測(<math>\text{output}_i</math>)同第 <math>i</math> 個實際經驗到嘅數值(<math>y_i</math>)之間嘅差異,呢個數字嘅次方一定會係[[正數]],所以將所有次數嘅誤差加埋<ref group="註"><math>\sum</math> 係[[加總]]。</ref>就會反映部感知機做咗 <math>N</math> 次預測之後嘅總誤差。如果每次嘅預測都同實際經驗到嘅數值一樣(<math>\text{output}_i = y_i</math>),<math>E(X) = 0</math>。喺呢個情況下,一個學習演算法要做嘅嘢就係改變柞 <math>w</math> 嘅數值同埋 <math>b</math>,務求最後令到 <math>E(X)</math> 嘅數值有咁細得咁細<ref name="haykin2009"/>。
=== Delta 法則 ===
第69行 ⟶ 第70行:
;第二步:更新權重值
#每一個權重值,佢都會由條式嗰度有一個'''梯度值'''(gradient);
#每一個權重值嘅改變幅度等如個梯度值乘以 <math>\eta</math>-如果 <math>\eta</math> 係 0,噉個神經網絡永遠都唔會變,而如果 <math>\eta</math> 數值大,噉個神經網絡會變化得好快,所以 <math>\eta</math> 掌管咗個神經網絡學習有幾快;
#將邇柞值「反向傳播」返去個神經網絡嗰度,將每個權重值變成佢嘅新數值(實際更新 <math>w_{ij}</math> 值);
第77行 ⟶ 第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]]
第85行 ⟶ 第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]]
第92行 ⟶ 第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> 當中
第105行 ⟶ 第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> 係一個
如果一個以電腦程式寫嘅神經網絡跟呢條式(或者係類似嘅式)嚟行嘅話,佢喺計完每一個個案之後,都會計出佢裏面嘅權重值要點樣改變,並且將呢個「每個權重應該要點變」嘅資訊
多層感知機嘅訓練演算法同單層感知機嘅基本上一樣。
==
以下係一個用 [[C#]] 整嘅多層感知機網絡[[源碼]](「initialize」係指[[初始化]])<ref name="tdsCsharpANN">[https://towardsdatascience.com/building-a-neural-network-framework-in-c-16ef56ce1fef Building a neural network framework in C#]. ''Towards Data Science''.</ref>:
第294行 ⟶ 第295行:
*Foreach 網絡,佢哋睇吓個網絡做完學習之後做預測嘅準確性係點。佢哋發現複合前饋網絡嘅表現好過普通就噉一個前饋網絡嘅-所以佢哋就發現咗一啲有用嘅嘢,可以將佢哋嘅研究成果喺有關[[機械學習]]嘅學術期刊上公佈。
{{clear}}
== 註釋 ==▼
{{Reflist|group=註|3}}▼
== 睇埋 ==
*[[人工神經網絡]]
第304行 ⟶ 第300行:
*[[反向傳播算法]]
*[[機械學習]]
*[[自編碼器]]
==
*Abu Dalffa, M., Abu-Nasser, B. S., & Abu-Naser, S. S. (2019). [http://dstore.alazhar.edu.ps/xmlui/bitstream/handle/123456789/142/DALTLUv1.pdf?sequence=1&isAllowed=y Tic-Tac-Toe Learning Using Artificial Neural Networks] (PDF).
*Bhaskar, K., & Singh, S. N. (2012). [https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=6170987 AWNN-assisted wind power forecasting using feed-forward neural network] (PDF). ''IEEE transactions on sustainable energy'', 3(2), 306-315.
*Valian, E., Mohanna, S., & Tavakoli, S. (2011). Improved cuckoo search algorithm for feedforward neural network training. ''International Journal of Artificial Intelligence & Applications'', 2(3), 36-43.
{{clear}}
▲== 註釋 ==
▲{{Reflist|group=註|3}}
== 攷 ==
{{reflist|3}}
== 拎 ==
*[https://web.archive.org/web/20090507210502/http://www.emilstefanov.net/Projects/NeuralNetworks.aspx Feedforward neural networks tutorial].
*[https://web.archive.org/web/20090923121811/http://wiki.syncleus.com/index.php/DANN%3ABackprop_Feedforward_Neural_Network Feedforward Neural Network: Example].
*[http://media.wiley.com/product_data/excerpt/19/04713491/0471349119.pdf Feedforward Neural Networks: An Introduction].
▲{{Template:機械學習}}
[[Category:人工神經網絡]]
|