hopfield neural network (hnn)
DESCRIPTION
Hopfield Neural Network (HNN). 霍普菲爾神經網路 ( 非監督式學習 --【 聯想式學習 】 ). 聯想式學習. 自聯想 (auto-associative) Input 與對應的 Target 相同 由一個樣式聯想同一個樣式 異聯想 (hetero-associative) Input 與對應的 Target 不同 由一個樣式聯想另一個樣式. 聯想式學習 ( 續 ). 架構 Feedforward Recurrent. 聯想式學習 ( 續 ). - PowerPoint PPT PresentationTRANSCRIPT
Hopfield Neural Network (HNN)
霍普菲爾神經網路 (非監督式學習 --【聯想式學習】 )
聯想式學習自聯想 (auto-associative)
Input與對應的 Target相同由一個樣式聯想同一個樣式異聯想 (hetero-associative)
Input與對應的 Target不同由一個樣式聯想另一個樣式
聯想式學習 (續 )架構
Feedforward
Recurrent
聯想式學習 (續 )How many patterns can be stored before the net starts to forget patterns it has learned previously ?
Binary : N patterns 2N 0.15NBipolar :
A measure of associative net. Performance
Capacity
N
NM
2log2
聯想式學習 (續 )Learning
Hebb rule
L
ii
T
mn
yxW
yyyxxx
i1
2121 ) ,..., ,(y ) ,..., ,(x
X1=(1,-1,1,1,1,-1) y1=(1,1,-1,-1)X2=(1,1,1,-1,-1,-1) y2=(1,-1,1,-1)
200202
022020
022020
2-00202
111111
1
1
1
1
111111
1
1
1
1
W
聯想式學習 (續 )• If the input vectors are orthonormal perfect recall
• If the input vectors are not orthonormal cross talk
• Testing
( 1 , 1, -1 , -1) × × × × -1+1-1+1=0(-1, 1 , 1 , -1)
ki
ikkkii
k ikiyxxyxxyxWx TT
L
1
T
聯想式學習 (續 )• Normalization
– By the Hebb rule by a factor of 1/n– n : the number of units in the system
1
1
1
1
6
6
6
6
6
1
6
6
6
6
1
1
1
1
1
1
200202
022020
022020
2-00202
Hetero-associative Net.
Example(1,0,0,0) (1,0)(1,1,0,0) (1,0)(0,0,0,1) (0,1)(0,0,1,1) (0,1)
20
10
01
02
10
1
1
0
0
10
1
0
0
0
01
0
0
1
1
01
0
0
0
1
W
Hetero-associative Net.(續 )Testing
0 0
0 1
x if
x iff(x)
)1,1()1,1(
20
10
01
02
)0,1,1,0(
)0,1()0,1(
20
10
01
02
)0,0,1,0(
)0,1()0,2(
20
10
01
02
)0,0,0,1(
Auto-associative Net.
Example (1,1,-1,-1), (-1,1,1,-1)
0020
0002
2000
0200
2020
0202
2020
0202
1111
1
1
1
1
1111
1
1
1
1
W
對角線設為 0
避免值過大
Auto-associative Net.(續 )Testing
111122222
1
2222
0020
0002
2000
0200
1111
Hopfield Network基本架構
Single layer每個處理單元皆有一個狀態值每個狀態值會一直變化到最後呈現穩態 (穩定到一個固定值 )每個處理單元間彼此互相連結 (完全連結 )
Hopfield Network(續 )學習過程設定網路權重值即完成學習
L
1
TWi
ii xx
{+1,-1,+1,-1,+1,-1}{-1,+1,-1,+1,-1,-1}{+1,+1,+1,+1,+1,+1}{-1,-1,-1,-1,-1,-1}
004040
000404
400040
040004
404000
040400
404040
040404
404040
040404
404040
040404
111111
1-
1-
1-
1-
1-
1-
...111111
1-
1
1-
1
1-
1
W
Hopfield Network(續 )回想過程讀入權重值矩陣輸入初始變數向量 X計算新的狀態變數向量 X
反覆上一步,直到收斂為止
Thresholdsnet
Thresholdsnetx
Thresholdsnet
x
xwnet
i
i
old
i
i
new
i
old
jiji
if 1
if
if 1
Thresholds=0
Hopfield Network(續 )
1
1
1
1
1
1
0
8
0
8
8
8
1
1
1
1
1
1
004040
000404
400040
040004
404000
040400
1
1
1
1
1
1
8
8
8
8
8
8
1
1
1
1
1
1
004040
000404
400040
040004
404000
040400
Epoch 1
Epoch 2
維持原來的值
Hopfield Network(續 )網路輸出值的修正同步修正 (synchronous update)•網路輸出值即為下一 epoch的輸入值非同步修正 (asynchronous update)•網路輸出值每次只挑選一個與原來輸入值不同的處理單元進行修正( index最小者),修正後的輸出值即為下一 epoch的輸入值
•收斂的機會較大
1
1
1
1
01
10
1
1
1
1
01
10
1
1
1
1
01
10
1
1
1
1
01
10
1
1
1
1
01
10
Hopfield Network(續 )
:
:
1
1
1
1
01
10
1
1
1
1
01
10
1
1
1
1
01
10
Hopfield Network(續 )能量函數 (Lyapunov function)用以判斷是否會收斂能量函數趨近於 0,表示會收斂
T2xxWx
: 2
T
1 1 1
ThresholdTxTxxwxHn
i
n
j
n
iiijiij
Hopfield Network(續 )因 Hopfield並無訓練目標值,因此無法以MSE、 RMSE或誤判率來衡量網路誤差大小因此,以能量函數進行誤差的衡量•簡化能量函數
•當各處理單元的狀態變數值所構成向量與訓練範例特徵向量之一相似或相同時,能量函數傾向較低的值
1 11 1 2
1 .or.
i jjiji
i jjiji xwxExwxE
Hopfield Network(續 )應用雜訊過濾資料擷取最佳化• Travel Salesman Problem, TSP• Linear programming• Job shop scheduling
Hopfield Network(續 )圖樣辨識