Adaptive lineare Transformationen AS-2 Rüdiger Brause: Adaptive Systeme, Institut für Informatik,...
-
Upload
mariele-franke -
Category
Documents
-
view
105 -
download
0
Transcript of Adaptive lineare Transformationen AS-2 Rüdiger Brause: Adaptive Systeme, Institut für Informatik,...
Adaptive lineare Transformationen
AS-2
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 2 -
Lineare Schichten
Sequenz linearer Schichten
y(1) = A x(1)
y(2) = B x(2)
...
y(n) = Z x(n)y(n) = ZBAx(1)
y(n) = M x(1)
_______
Z B A x(1)y M
Sequenz linearer Schichten = wie nur 1 Schicht !
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009
PCA-Netze
PCA-Transformation
Transform Coding
ICA-Transformation
Weissen
- 3 -
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 4 -
Hebb‘sches Lernen
w = wi(t)-wi(t-1) = i(t) yix Iterative Hebb'sche Lernregel
W = W(t)-W(t-1) = (t) yxT
W = W(1) + W(2) + W(3) + …
Problem: ex. kein „Vergessen“, w
Unendliches Wachstum ??
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 5 -
Hebb‘sches Lernen - Ergänzungen
Lösung 1: lin. Term, Abklingen der Synapsen
w(t) = w(t-1) + (t) yx Iterative Hebb'sche Lernregel
w(t) = w(t-1) + (t) (yx - w(t-1)) Abklingen des Gewichts
-1 w(t)-w(t-1) = yx - w(t-1) Diff.gleichung mit = 1/ t
w
Erwartetes Ziel bei lin. System y = wTx Cxx:=
xxT
= 1xy - 2 w = 1xxTw - w = 1xxT w - 2w = 0
Cxxw = w bei Fixpunkt w = w*Eigenvektor von Cxx
t
w
w* stabil? 1-dim Beispiel: Nein!
= 1xy - 2 wn nicht-lin. Abklingterm n>1t
w
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 6 -
Hebb‘sches Lernen - Ergänzungen
Lösung : Normierung der Gewichte
w(t) = w(t-1) + (t) yx mit |w(t)| = 1
Wie?
(t) = (t-1) + (t) yx
w(t) = ____= (t-1) + (t) yx | | | |
w
Wohin konvergiert w(t) ?
Rechnung Eigenvektoren der Autokorrelationsmatrix Cxx:= xxT !
w
ww w
w
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 7 -
Lernen: beschränkte Hebbsche Regel
Konvergenzziel?
wi(t) = wi(t-1) + i(t) yix Hebb'sche Lernregel mit |w| = const.
= wi(t-1) + i(t) Gradientenaufstieg w
w
R
Also:
= xy = xxT w = Aw bei y = xTw lin. Neuron
R(w) = ½ wTAw mit |w| = const = 1 Zielfunktion
w
w
R
Extremwert von L(w,µ) = R(w) + µ·(|w|2 – 1) Lagrangefunktion
bei (w,) = + 2w = Aw + 2w = 0
Aw = w Eigenwertgleichung mit := –2
w EV(A) mit EW = max
wL
w
w
)(R
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 8 -
Principal Component Analysis PCA
Zerlegung in orthogonale Eigenvektoren = Basisvektoren„Hauptkomponentenanalyse“, „principal component analysis“,„Karhunen-Loéve-Entwicklung“, „Hotelling-Transformation“,...
Eigenvektoren – Wozu?
e1
e2
Merkmals-transformation
auf Hauptrichtungen
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 9 -
Principal Component Analysis PCA
Transformation auf Unkorreliertheit
Beispiel
x1
x2
(x1-x1)(x2- x2) = 0 Unkorrreliertheit von x1,x2
Rauschfrei korrelierte Daten
x = (x1,x2) mit x2 = ax1
Rechnung: EV, EW = ?
Dekorrelation und Unabhängigkeit
Hinweis: PCA dekorreliert Daten
DEF PCA: y = wTx mit Cxxw = w Eigenvektoren
DEF dekorreliert: (yi-yi)(yj- yj) yi-yiyj-yj= 0 i≠j
Mit PCA gilt yiyj= wi
Tx xTwj wiTx xTwj wi
TCxxwj = wiT jwj
= da ja wiTwj = gilt.
Daten sind unabhängig Daten sind dekorreliertDEF unabhängig: P(xi,xj) = P(xi)P(xj) xi,xj Zufallsvariable
yiyj
= yiyj= 0 bei yi=0 i≠j
Aber: umgekehrt gilt nicht: dekorreliert ist nicht unabhängig!Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 10 -
1 bei i = j
0 bei i j
i bei i = j
0 bei i j
i j
i j i jy ,y
P(y , y )y yi j
i j i jy y
P(y )P(y )y yi j
i i j jy y
P(y )y P(y )y
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 11 -
R(W) = min (x- )2 least mean squared error (LMSE)
Transformation mit minimalem MSE
Allgemeine Situation
wmin x
. · · ·
l i n . T r a n s f o r m a t i o n
W x
x 1
x n
X {
y
}.. 1
y my
Ym+1..Y n
Wann minimal ?
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 12 -
Transformation mit minimalem MSE
Was ist die beste Schätzung für die Konstanten ci?
min R(ci) = ? Rechnung! Anhang B
R(W) = min (x- )2 least mean squared error (LMSE) w
min xMinimaler Rekonstruktionsfehler
Bei welchen Basisvektoren wi ist der Fehler minimal ?
min R(wi) = ? Rechnung! Anhang B
yi = xTwi
m
i ii 1
y w
n
i ii m 1
y w+
x =m
i ii 1
y w
n
i ii m 1
c w+ =x
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 13 -
Transformation mit minimalem MSE
m Messungen f(x)
x
Modellierung als Gerade
y = f(x) = y0 + ax
Beispiel: Ökonomie Konsum y = f(Einkommen x)
= Konsumsockel + a Einkommen
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 14 -
Transformation mit minimalem MSE
Minimaler mittlerer Abstand zur Gerade (Hyperebene)
c
ux
d
Hyperebene mit g(x*) = 0
w
= x*Tu/|u| – c = x*Tw – c
Hessesche Normalform
d = xTw – c = g(x)
TLMSE = R(w,c) = d2
Rechnung: Minimum des TLMSE (Kap.3.3.1)
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009
PCA-Netze
PCA-Transformation
ICA-Transformation
Weissen
- 15 -
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 16 -
EINE Lernregel für Hebb-Lernen und Gewichtsnormierung
Hebb-Regel w(t) = w(t-1) + (t) yxNormierung wi(t)
Einsetzen 1. in 2. w(t-1) + (t) yx
[i(wi(t-1)+xiy)2]1/2
und f() in einer Taylorreihe nach entwickeln.
Oja-Lernregel
)t(
)t(w i
w
Terme mit 2 vernachlässigen ergibt
w(t) = w(t-1) + (t) y [x(t) w(t-1)y] Oja Lernregel
xneu
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 17 -
PCA Netze für den Unterraum
Oja-Netz
x1
xn
· · ·
Y1
ym
· · ·x y
w(t) = w(t-1) + (t) y [x(t) w(t-1)y] Oja Lernregel
wi(t) = wi(t-1) + (t) yi[x(t) x]x = wi(t-1)yi
m
i ii 1
y
x w
Ansatz: Zielfunktion R(w) = (x- )2 minimierenx
Konvergenzziel: Unterraum der EV mit größtem EW
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 18 -
PCA Netze für geordnete Zerlegung
Sanger-Methode Sanger 1988
Vollständige Zerlegung von {x} in n Eigenvektoren (Gram-Schmidt)
{x}0 = {x}, i=1
1.Suche die Richtung größter Varianz in {x}i-1. Dies ist ei.
2.Ziehe diese Richtung (Dimension) von {x}i-1 ab. Wir erhalten {x}i .
3.Wenn i<n, setze i := i+1, gehe zu 1.
Diskret für stochastisches x, w: Sanger-Netz
X x1 X m - 1 X m
W 1 e1 W M e M· · ·
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 19 -
PCA Netze für geordnete Zerlegung
Sanger-Methode: stochastischer Algorithmus
Lernen: wi(t) = wi(t–1) + (t) yixi "Generalisierte" Hebb-Regel
MusterreduktionStufe 1 x2 := x1 - w1(t–1)y1 x2 x1 !!
Stufe k
xk+1 := xk + awk(t–1)yk und x1 := x, a := –1, k = 1..i–1
Lernen Stufe k wk+1(t) = wk(t–1) + (t) yk(xk +a )
a = –1 max EW, a = +1 min EW
1k
1jjjyw
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 20 -
PCA Netze durch laterale Inhibition
Asymmetrische Netze Rubner, Tavan 1990
yi = wiTx + Aktivität
= (wi + )Tx =:
ik kk i
u y
ik kk i
u w xw T
i~
wi = xyi Hebb-Lernen
uik = - yiyk Anti-Hebb-Lernen
Anti-Hebb auch aus Prinzip „kleinste gemeins. Information“ H(yk,yi)
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009
PCA-Netze
PCA-Transformation
ICA-Transformation
Weissen
- 21 -
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 22 -
Whitening Filter
Shannon: Whitening für alle Frequenzen, d.h. alle diskreten Signalbänder
Übertragung auf parallele Signale yi : gleiche Varianz aller durchTransformation W.Anhebung zu geringer Amplituden: Wähle W so,
daß = 1 bei i = j, und =0 sonst; also yyT = I
Absenkung der Amplituden: durch inverse Matrix W-1
ji yy
Rauschen
Kodierung Transmission Dekodierung
Transformation
Wx
x~
inverseTransformation
W-1
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 23 -
Whitening Filter
Anhebung bei parallelen SignalenWenn für die Transformation M eine orthonormale Basis M-1 = MT gewählt wird, ist das Ziel des Lernens
mit I = yyT = MxxTMT = MxxTMT = MAMT
auch MTM = MT (MAMT) = AMT
bzw. mk = Amk Eigenvektoren mk von A mit = 1
Also:
1. Signal zentrieren und PCA durchführen. Wir erhalten orthonormale Eigenvektoren ei mit Eigenwerten i.
2. ei normieren: wi = ei / i1/2 so dass | wi |2 =1/ i .
Es ergibt sich orthogonale Transformationsmatrix W mit Zeilenvektoren wi
Sie erfüllt yiyi = wiTxxTwi = wi
TAwi = wiTwii = 1
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 24 -
Whitening Filter
Absenkung (Rücktransformation)
Wenn B = (1w1,..., nwn) gewählt wird, ist mit |wi|2 = i-1
mit WB = = = I,
Also ist B = W-1 mit den Spalten aus den Zeilen von W.
Also: Rücktransformation
1. Aus der PCA haben wir ei, i mit |ei|2 = 1 und so die Matrix W mit |wi|2 = i-1
2. Basis bi bilden aus W : bi = (1w1i, 2w2i, ..., nwni)
T1
Tn
...
w
w
10
00
01
1 1 n n
w w
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 25 -
Orthonormalisierende Netze
Heuristische Methode Silva, Almeida 1991
w i
w j
- w j
-wi
Projektion aij := wiTwj eines
Basisvektors wi auf einen
anderen wj vermindern
wi(t) = wi(t-1) - (t) aijwj(t-1)
= wi(t-1) - (t) (wiT(t-1)wj(t-1)) wj(t-1)
wi(t) = wi(t-1) – (t) j i
( wi
T(t-1)wj(t-1) ) wj(t-1) Alle Einflüsse
Datenkorrelationenyiyj wj(t-1)
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 26 -
Orthonormalisierende Netze
Symmetrisches, lateral inhib.Netz Brause, Rippl 1998
Vor: zentrierte Eingabe x
Ziel: min Kreuzkorr., Autokorr. = 1
R(w) = ¼i jyiyj2 ¼i(yi2-1)2
Gradientenabstieg
wi(t) = wi(t-1) (t)x (juijyj + yi) uij = - yiyj lateral inhibition
Konvergenz der Transformation: lat. Inhib. uij wird null
m
2i i i j j i i
j 1, j iNormierung
Dekorrelation
t t 1 t y y y y 1 y
w w x x
Stoch.Version
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 27 -
Orthonormalisierende Netze
Symmetrisches, lateral inhib.Netz Plumbley 1993
y1
y2
ym
x1
x2
xn
y = x Uy Aktivität
(I+U) y = x y = (I+U)-1x = Wx lin. System
tyty
tytu1tu
ji
2i
ijij sonst
ji
Konvergenz der Transformation: lat. Inhib. uij wird nicht-null
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 28 -
Ausblick: lineare und nichtlineare PCA
Lineare
HauptachsentransformationDynamische Hauptachsentransformation
e2
b1
b2 e1 e2
b1
b2
e1 e1
e1
e2
e2
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009
PCA-Netze
PCA-Transformation
ICA-Transformation
Weissen
- 29 -
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 30 -
Lineares ICA-Modell
Ms1
s2
sn
x1
x2
xn
Wy1
y2
yn
Quellenmix Entmischung
Ziel: W M-1
y s
mit p(y) = p(y1,..,yn) = p(y1)..p(yn) unabhängige Kanäle
Unabhängigkeit notwendig zur Quellentrennung.
Yelling,Weinstein (1994): auch hinreichend!
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 31 -
Lineare Koordinatentransformationen
PCA-Hauptkomponentenanalyse Richtung stärkster Varianz ICA- Unabhängigkeitsanalyse statistische Unabhängigkeit
Beispiel:
1
b2
b ,
e 2
e 1
c 2
1c
Beispiel:
c1 := x-y, c2 := y
also c1= x1 unabh.
von c2= x2
M-1 =
x = x1+x2,
y = x2
mit x1,x2 zufällig uniform aus [-1,+1]
M =
10
11
10
11
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 32 -
ICA-Einschränkungen
Quellenzahl = Mischzahl M muß regulär sein nur dann ex. M-1
Ausgabereihenfolge unbestimmtReihenfolge in p(y1)..p(yn) ist unwichtigbis auf Permutation
P bestimmbar: MM P
Unbekannte Skalierung
i= 1 Beweis: Rechnung Kap.3.4
2 Gaußsche Quellen lassen sich nicht trennen
max 1 Gaußsche Quelle Beweis: Rechnung Kap.3.4
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 33 -
DEF Information
I ~ n = ld(2n) = ld (Zahl der möglichen Daten)
I ~ ld(1/P) [Bit]
DEF I(X) := ln(1/P(xk)) = – ln(P(xk)) Information
DEF H(X) := k P(xk)I(xk) = I(xk)k Entropie
H(X) :=
p(x) ln p(x)-1dx differenzielle Entropie
Frage: Wieviel Information hat eine 32-bit floating-point Zahl?
DEF I(X;Y) = H(X) + H(Y) – H(X,Y) Transinformationmutual information
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 34 -
Ziel: minimale Transinformation zwischen den Ausgaben yi
x = InputKanäle,
stoch. Variable
y = Output
Transinformation I(y1;y2) = H(y1) + H(y2) – H(y1,y2)
minimal bei I(y1;y2) = 0 bzw. maximaler Entropie H(y1,y2) = H(y1) + H(y2)
bzw. p(y1,y2) = p(y1)p(y2) stochastische Unabhängigkeit der Variablen yi
· · ·
· ·
·
X1
xn
y1
ym
T ra n sfo rm a tio n(F il te r)
X y
y
ICA - Algorithmen 1a
-
W(t+1) = W(t) – I(y1;y2;..;yn) Gradientenabstieg
(Amari, Young, Cichocki 1996)
Entwicklung von p(y1,y2,..,yn) in I(y1;y2;..;yn) nach höheren Momenten
W(t+1) = W(t) – (1-f(y)yT)W(t) mit fi(yi) = 34
11 254
9 143
7 474
5 294
3y y y y y
w
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 35 -
Informationstransformation
Transformation
kontinuierlicher
Zufallsvariabler
H(Y) = H(X) + log |det(W)|
= – p(x) ln p(x) dx +
p(x) ln |det J|dx J(x) = Wx
x1
xn
y1
yn
Trans-formation J
H(Y) = –
p(y) ln p(y) dy p(y) = p(x) |det J|-1
H(Y) = ? H(Y) = H(Y(X))
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 36 -
Transinformation I(X;Y) = H(Y) – H(Y|X) aus Def.
H(Y|X) ist konstant im determinist. System
R(w) := H(Y) = H(X) + p(x) ln |det J|dx mit J =
Nicht-lin. Ausgabe, z.B. y = tanh(z)GradientenregelW(t+1) = W(t) + ( – 2yxT) Rechnung: 1-dim Fall (Kap.3.4.1)
„Natürl.“Gradient Amari 1985
= W = (t) WTW = (I – 2yzT)W
ICA - Algorithmen 1b
- Ziel: maximale Transinformation (Bell, Sejnowski 1995)
zwischen Eingabe und Ausgabe
1T W
i
j
y
x
dt
dWW
W
)(R
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 37 -
Momente einer Zufallsvariablen x : i= x i, z.B. 1 = x Mittelwert
Zentrale Momente einer Zufallsvariablen x: mk= (x-1)k, z.B. m2 = (x-1)2 Varianz
Wölbungsmaß Kurtosis: kurt(x) = [(x-1)4 -3m22]/m2
2
Statist. Momente und Kurtosis
Supergaussian: Kurtosis > 0
Gaussian: Kurtosis = 0
Subgaussian: Kurtosis < 0
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 38 -
ICA-Algorithmen: Vorverarbeitungsfolge
Zentrieren Mittelwertbildung, z.B. iterativ durch w0(t+1) = w0(t) - (w0-x), =1/t
Weißen PCA durchführen: wi Eigenvektoren von C = xxT mit |wi|=1 und
Eigenwerten i
Gewichtsvektoren wi normieren zu wi/i1/2. Dies führt zu y2 = wi
TxxTwi =
wiTiwi = 1
Entmischen ICA Algorithmen, z.B. minimale Transinformation, maximale Kurtosis etc. Speziell: dekorrelierte x benötigen nur eine orthogonale Matrix W
(Vereinfachung)
Ms1s2 sn
x1
x2
xn
x-xy1
y2 yn
B
Quellenmix zentrieren weißen entmischen
W
x (xx
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 39 -
Ziel: extremale Kurtosis (Delfosse, Loubaton 1995)
Extrema bei sj = unabh. Komp, und zj = +/-1
kurt (y) = kurt (wTv) = kurt(wTMs) = kurt (zTs) =
ICA – Algorithmen 2
z kurt sjj
n
j4
1 ( )
M
s1s2 sn
v1
v2
vn
y1
y2 yn
Quellenmix zentrieren weißen entmischen
W
vi(viviMatrix Z
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 40 -
ICA – Algorithmen 2
Lernalgorithmus für einzelnes Neuron (Hyvarinen, Oja 1996)
w(t+1) = (wTv)3v – 3 w Fixpunktalgorithmus
mit |w| = 1
Ziel: extremale Kurtosis bei y = wTv
R(w) = (wTv)4 – 3 (wTv)22 = minw
w(t+1) = w(t) + grad R(w)
= w(t) + 4 ((wTv)3v – 3|w|2 w)
Bei |w| = 1 ist die Richtung gegeben durch
w(t+1) = ((wTv)3v – w)
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 41 -
ICA – Algorithmen 2
Sequentielle Extraktion aller Komponenten
Gegeben: Trainingsmenge {v(0)}
w1(t+1) = (w1Tv)3v – 3 w1 mit |w1| = 1
Konvergenz zum 1. ICA-Vektor.
Dann neue Trainingsmenge durch v(1) = v(0) – w1y1
w2(t+1) = (w2Tv)3v – 3 w2 mit |w2| = 1
Konvergenz zum 2. ICA-Vektor, usw.
Schnellere Konvergenz: Orthogonalisierung
wi(t+1) = wi(t) - (wi wj) wj j < i
1i
1j
Rüdiger Brause: Adaptive Systeme, Institut für Informatik, WS 2009 - 42 -
ICA-Anwendung: Audioanalyse
Mix1
Mix2
Mix3
Mix4
speaker
singer
violin
orchestra
Mischung entmischte Quellen