22 Ann
22 Ann
ARTIFICIAL NEURAL
NETWORK
DEDY WIRAWAN SOEDIBYO
Dedy.soedibyo@gmail.com
REVIEW MCCULLOCH-PITTS
• Neuron sederhana yang pertama diperkenalkan pada 1943
• Disebut juga sebagai Threshold Logic Neuron (TLN)
• Fungsi aktivasinya biner sehingga sering disebut sebagai simple binary
threshold neuron
p1 w1
w2 a
a f (n) 1, n threshold p2
w3 f
0, n threshold p3
w4
p4
REVIEW MCCULLOCH-PITTS
1. Model neuron McCulloch-Pitts untuk menyatakan fungsi logika AND
p1 p2 a Neuron yang sesuai adalah (dengan coba-coba):
0 0 0 p1 1
n a
0 1 0 f
1
1 0 0 p2
1 1 1 w1 = w2 =1
Threshold = 2
p1 p2 n = p1 w1 +p2 w2 a = f(n)
0 0 0.1+0.1=0 0 a f (n) 1, n threshold
0 1 0.1+1.1=1 0 0, n threshold
1 0 1.1+0.1=1 0
1 1 1.1+1.1=2 1
REVIEW MCCULLOCH-PITTS
2a. AND dengan threshold yang dapat diubah dengan menggunakan bias:
Menentukan persamaan garis pemisah:
Banyak garis-garis
pemisah yang mungkin dipilih
𝑝2=𝑚 𝑝1 +𝑐
REVIEW MCCULLOCH-PITTS
2b. AND lanjutan (dengan bias)
Pembobotan dan bias dapat ditentukan secara
a analisis:
f (n) 1, n 0 p1 1
0, n 0 threshold 0 n a
f
w2 w wb 1
n w1 p1 w2 p2 bwb 0 p2 1 p1 b p2
w2 w2 w2 wb = - 2
dari persamaan garis :
b =1
w wb
p2 p1 2 1 1 dan b2
w2 w2 p1 p2 n = p1 w1 +p2 w2 + b wb a = f(n)
0 0 0.1+0.1 - 2=- 2 0
w2 1 w1 1 wb 2 0 1 0.1+1.1 - 2= -1 0
1 0 1.1+0.1 - 2 =- 1 0
1 1 1.1+1.1 - 2= 0 1
REVIEW MCCULLOCH-PITTS
3. OR tanpa bias
p1
p1 p2 a 1
n a
0 0 0 f
0 1 1 1
1 0 1 p2
1 1 1
w1 = w2 =1
Threshold = 1
p1 p2 n = p1 w1 +p2 w2 a = f(n)
0 0 0.1+0.1=0 0
0 1 0.1+1.1=1 1
1 0 1.1+0.1=1 1
1 1 1.1+1.1=2 1
REVIEW MCCULLOCH-PITTS
4a. OR dengan bias
p2 mp1 c
titik (0,1) 1 0 n n 1
titik (1,0) 0 m.1 1 m 0 1 m 1
p 2 p1 1 persamaan garis pemisah
p1 p2 a
0 0 0
0 1 1
1 0 1
1 1 1
REVIEW MCCULLOCH-PITTS
4b. OR dengan bias (lanjutan)
p1 1
n a
a f (n) 1, n 2 f
1
0, n 2 threshold 2 p2
w2 w wb 2 Wb = 1
n w1 p1 w2 p2 bwb 2 p2 1 p1 b
w2 w2 w2 w2 w1 = w2 =1
b =1
dari persamaan garis : Threshold = 2
w1 1
p2 p1 1 1 dan ( wb 2) 1 wb 1 2
w2 w2
p1 p2 n = p1 w1 +p2 w2 + b wb a = f(n)
w2 1 w1 1 wb 1
0 0 0.1+0.1+ 1.1=1 0
0 1 0.1+1.1+ 1.1=2 1
1 0 1.1+0.1+ 1.1=2 1
1 1 1.1+1.1+ 1.1=3 1
REVIEW MCCULLOCH-PITTS
p2
XOR
p1 p2 XOR
0 0 0
0 1 1
1 0 1
1 1 0
p1
Ternyata jaringan untuk menyatakan fungsi logika XOR tidak bisa dibuat seperti
contoh-contoh yang lalu (tidak dapat dipisahkan oleh sebuah garis).
Baru dapat dipisahkan dengan dua buah garis, sehingga perlu digunakan sebuah
lapisan tersembunyi (hidden layer)
REVIEW MCCULLOCH-PITTS
p1 p2’
Neuron yang sesuai adalah (dengan coba-coba):
p1 p2 p2’ p1 p2’
0 0 1 0 p1 2 w1 = 2
n a
0 1 0 0 f w2 = -1
1 0 1 1 Sum of product -1 Threshold = 2
1 1 0 0 p2
p q p’ q
(p q)’ = (p’ q)’ = p q’
p1 p2 n = p1 w1 +p2 w2 a = f(n)
0 0 0.2+0.-1=0 0
0 1 0.2+1.-1= - 1 0
1 0 1.2+0.-1=2 1
1 1 1.2+1.-1=1 0
irisan (AND) - union (OR)
REVIEW MCCULLOCH-PITTS
p1 w1
n a p1 p2 n = p1 w1 +p2 w2+ b wb a = f(n)
f
w2 0 0 0.1+0.1+1 = 1 1
p2
wb 0 1 0.1+1.1+1= 2 1
f (n ) 1, n 0
b 1 0 1.1+0.1+1= 2 1
0, n 0
1 1 1.1+1.1+1= 3 1
Keluaran target Jaringan Hebb ‘tidak dapat mengerti’ pola yang dimaksud
MODEL NEURON HEBBMasukan Target Perubahan bobot Bobot baru
w = pi t b = t wbaru = wlama + w
b). Masukan biner dan keluaran wbbaru = wblama +
wb
bipolarMasukan Target
p1 p2 1 t w1 w2 wb w1 w2 wb
p1 p2 b t
Inisiasi 0 0 0
0 0 1 -1
0 0 1 -1 0 0 -1 0 0 -1
0 1 1 -1
w1 = 0, 0 1 1 -1 0 -1 -1 0 -1 -2
1 0 1 -1
w2 = 0, 1 0 1 -1 -1 0 -1 -1 -1 -3
1 1 1 1 wb = -2 1 1 1 1 1 1 1 0 0 -2
p1 w1
n a p1 p2 n = p1 w1 +p2 w2+ b wb a = f(n)
f
w2 0 0 0.0+0.0 - 2 = -2 -1
p2
wb 0 1 0.0+1.0 -2 = - 2 -1
b 𝑓 (𝑛)=1,𝑛≥0
1
1
0
1
1.0+0.0-2 = - 2
1.0+1.0 - 2= -2
-1
-1
Keluaran target Jaringan Hebb ‘tidak dapat mengerti’ pola yang dimaksud
MODEL NEURON HEBBMasukan Target Perubahan bobot
w = pi t b = t
Bobot baru
wbaru = wlama + w
wbbaru = wblama +
b). Masukan bipolar dan keluaran wb
bipolarMasukan Target
p1 p2 1 t w1 w2 wb w1 w2 wb
p1 p2 b t Inisiasi 0 0 0
-1 -1 1 -1 -1 -1 1 -1 1 1 -1 1 1 -1
-1 1 1 -1 -1 1 1 -1 1 -1 -1 2 0 -2
w1 = 2, 1 -1 1 -1 -1 1 -1 1 1 -3
1 -1 1 -1
w2 = 2,
1 1 1 1 1 1 1 1 1 1 1 2 2 -2
wb = -2
p1 w1 p1 p2 n = p1 w1 +p2 w2+ b wb a = f(n)
n a
f -1 -1 -1.2+-1.2-2 = -6 -1
w2
p2 -1 1 -1.2+1.2-2= - 2 -1
wb
b 𝑓 (𝑛)=1,𝑛≥0
1
1
-1
1
1.2+-1.2-2= - 2
1.2+1.2-2= 2
-1
1
-1 1 1 -1
1 -1 1 -1
1 1 -1 -1
1 1 1 1