28
Artificial Neurons Perceptrons and the perceptron learning rule Sebastian Frühling – 29.04.2004

Artificial Neurons

Embed Size (px)

DESCRIPTION

Artificial Neurons. Perceptrons and the perceptron learning rule. Sebastian Frühling – 29.04.2004. Themen:. Definition KNN Vorbild aus der Biologie Simple Perceptrons Training eines Perzeptrons Schwellwerteinheiten Beispiel „ODER-Perzeptron“ Lineare Einheiten. Definition KNN. - PowerPoint PPT Presentation

Citation preview

Page 1: Artificial Neurons

Artificial Neurons

Perceptrons and the perceptron learning rule

Sebastian Frühling – 29.04.2004

Page 2: Artificial Neurons

Themen:

Definition KNN Vorbild aus der Biologie Simple Perceptrons Training eines Perzeptrons Schwellwerteinheiten

Beispiel „ODER-Perzeptron“

Lineare Einheiten

Page 3: Artificial Neurons

Definition KNN

„[…] a System composed of many simple processing elements operating in parallel whose function is determined by network structure, connecting strengths, and the processing performed at computing elements or nodes “

DARPA Neural Network study, Fairfax, VA: AFCEA International Press 1988

Page 4: Artificial Neurons

Vorbild aus der BiologieBiologisches Neuron Künstliches Neuron

iiw )( iiwg

Page 5: Artificial Neurons

Simple Perceptron

iiw )( iiwg

w1

w2

w3

w4

ε1

ε3

ε2

ε4

OZiel:

Output = gewünschte Ausgabe

!

)(

k

kkwghgO

O = Output Knoten

g() = Aktivierungsfunktion

wy = Gewicht Input y

εk = k-ter Input

Page 6: Artificial Neurons

Training eines Perceptrons

Page 7: Artificial Neurons

Simple Perceptrons

Schwellwerteinheiten

- Threshhold – Units -

Page 8: Artificial Neurons

Schwellwerteinheiten (Threshhold – Units)

Mit:

und:

sonst

hfürhhg

1

1)sgn()(

sonst

wfallswgwgO kk

kk)1(

1)()(

wwh ii

Page 9: Artificial Neurons

Schwellwerteinheiten (Threshhold Units) (2)

Die Projektion des Gewichtsvektors auf den Input-Vektor soll das gleiche Vorzeichen haben, wie die gewünschte Ausgabe

Die grenze zwischen +1 und -1 ist also genau die Ebene (Gerade oder Hyperebene wo wε = 0)

Die Ebene geht durch den Ursprung, falls kein Schwellwert gegeben

!

)sgn(

wO uu

w

Page 10: Artificial Neurons

Schwellwerteinheiten(Threshhold Units) - OR-Funktion Ist die OR-Funktion durch ein einfaches Perzeptron

darstellbar? Lineare Separierbarkeit

1

1x1 x2 x1 || x2

0 0 -1

0 1 1

1 0 1

1 1 1

0,5

0,5

Page 11: Artificial Neurons

Schwellwerteinheiten(Threshhold-Units) - Lösung

2 Möglichkeiten:

Lösung ausrechnen und fertig

Lösung „lernen“ lassen

Lernen = suk. Anpassung der Gewichte

Page 12: Artificial Neurons

Schwellwerteinheiten (Threshhold Units) - Beispiel

g(h) = sgn(h)

w1

w2

Schwellwert: Θ = 0,5

Initial Gewichte: w1 = 0,5 w2 = 0,7

ε1

ε2

ε1 || ε2

Page 13: Artificial Neurons

Ein einfacher Lernalgorithmus

Unter der Bedingung, dass es eine Lösung gibt (linear Separierbare Probleme) findet das Perzeptron sie (effizient) in einer endlichen Anzahl von Schritten

START: Choose any Value for w

TEST: Choose an e in F- || F+

If (e in F+) && (w.e – S > 0) goTo TEST

If (e in F+) && (w.e - S<= 0) goTo ADD

If (e in F-) && (w.e - S < 0) goTo TEST

If (e in F-) && (w.e - S>=0) goTo SUB

ADD: w := w + e

goTo TEST

SUB: w := w – e

goTo TEST

1

1 w

Page 14: Artificial Neurons

Schwellwerteinheiten(Threshhold-Units) - Beispiel

x1 x2 w1 w2 Σ G(Σ) Δ

0 0 0,5 0,7 0 -1 0

0 1 0,5 0,7 0,7 1 0

1 0 0,5 0,7 0,5 -1 1

0 0 1,5 0,7 0 -1 0

0 1 1,5 0,7 0,7 1 0

1 0 1,5 0,7 1,5 1 0

1 1 1,5 0,7 2,2 1 0

START: Choose any Value for w

TEST: Choose an e in F- || F+

If (e in F+) && (w.e – S > 0) goTo TEST

If (e in F+) && (w.e - S <= 0) goTo ADD

If (e in F-) && (w.e – S < 0) goTo TEST

If (e in F-) && (w.e – S >=0) goTo SUB

ADD: w := w + e

goTo TEST

SUB: w := w – e

goTo TEST

Schwellwert 0.5 !!!

Page 15: Artificial Neurons

Schwellwerteinheiten(Threshhold-Units) - Beispiel

w w

e e

TEST: Choose an e in F- || F+

If (e in F+) && (w.e – S > 0) goTo TEST

If (e in F+) && (w.e - S <= 0) goTo ADD

If (e in F-) && (w.e – S < 0) goTo TEST

If (e in F-) && (w.e – S >=0) goTo SUB

ADD: w := w + e

goTo TEST

SUB: w := w – e

goTo TEST

w

Page 16: Artificial Neurons

Schwellwerteinheiten (Threshhold-Units) - Beispiel

TEST: Choose an e in F- || F+

If (e in F+) && (w.e – S > 0) goTo TEST

If (e in F+) && (w.e - S <= 0) goTo ADD

If (e in F-) && (w.e – S < 0) goTo TEST

If (e in F-) && (w.e – S >=0) goTo SUB

ADD: w := w + e

goTo TEST

SUB: w := w – e

goTo TEST

w w

e

w

Schwellwert

w

w

Page 17: Artificial Neurons

Beweis über Konvergenz Zu zeigen: Falls eine Lösung existiert, so findet sie der

Lernalgorithmus in endlicher Zeit Ziel: finde obere Schranke für n (n Anzahl updates) Vorbedingungen:

W* ist der Optimal-Gewichtsvektor der Länge 1 W ist unser zufällig gewählter Gewichtsvektor Alle Pattern-Vektoren sind normiert Es gilt:

)(||||

)cos(

)cos(||||

wGww

ww

wwww

opt

opt

optopt

w*1

δ

0 w w

Page 18: Artificial Neurons

Beweis über Konvergenz

Betrachte Zähler und Nenner getrennt: Zähler:

Nach n-maliger Anwendung:

topt

opttopt

topttopt

ww

www

wwww

)(1

nww nopt

||||||)(

w

ww

ww

wwwG opt

opt

opt

Page 19: Artificial Neurons

Beweis über Konvergenz (2) Nenner:

Nach n-maliger Anwendung:

1||

||2||

)()(

||

2

22

112

1

t

tt

tt

ttt

w

ww

ww

www

nwnw nn |||| 2

Page 20: Artificial Neurons

Beweis über Konvergenz (3) Mit

1||

)(

n

noptn w

wwwG

n

n

1

11 nnn

n

Damit ist gezeigt, daß eine obere Schranke für die Updates des Gewichtsvektors mit endlicher Anzahl von Schritten gefunden wird.

Page 21: Artificial Neurons

Diskriminante D

Es gibt eine Möglichkeit die Lösbarkeit von Problemen zu prognostizieren:

D < 0 nicht mit einfachen Perzeptron lösbar D > 0 lösbar max(D) optimales Perzeptron

ww

wD min1

)(

Page 22: Artificial Neurons

Simple Perceptrons

Lineare Einheiten

- linear Units -

Page 23: Artificial Neurons

Linear Units g ist eine lineare, kontinuierliche und differenzierbare

Funktion

Ansonsten bleibt alles gleich ;-)

k

kkk

kk wwgO )(

iiw )( iiwg

Page 24: Artificial Neurons

Linear Units - Explizite Lösung Errechnen der exakten Werte; keine sukzessive

Verbesserung

Nur bei linear unabhängigen !!!

,

1)(1

kiik QN

w

k

kkNQ

1

Page 25: Artificial Neurons

Linear Units - Lernen mit absteigenden Gradienten

Definiere eine Kostenfunktion

Im Minimum der Kostenfunktion ist die Ausgabe = gewünschte Ausgabe suche nach Min

22

)(2

1)(

2

1)(

k

kkwOwE

Page 26: Artificial Neurons

Linear Units – Lernen mit absteigenden Gradienten (2)

Ein kleiner Schritt in Richtung des Minimums:

Wenn man das für jede Eingabe extra macht:

)( Ow

Ew

kk

)( Owk

Page 27: Artificial Neurons

Zusammenfassung

Simple Perceptrons können viele, sehr komplexe Probleme effizient lösen. D.h. aber NICHT, dass sie deshalb auch alle einfachen Probleme lösen können.

Wenn es eine Lösung gibt (das Problem ist linear Separierbar), dann findet der Lernalgorithmus des Perceptrons sie mit endlicherAnzahl von Schritten.

Page 28: Artificial Neurons

Simple Perceptrons

Danke …