unsupervised learning the hebb rule – neurons that fire together wire together. pca rf development...

48
Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Upload: theodore-lawrence-banks

Post on 26-Dec-2015

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Unsupervised learning

• The Hebb rule – Neurons that fire together wire together.

• PCA

• RF development with PCA

Page 2: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Classical Conditioning and Hebb’s rule

“When an axon in cell A is near enough to excite cell B and repeatedly and persistently takes part in firing it, some growth process or metabolic change takes place in one or both cells such that A’s efficacy in firing B is increased”

Ear

Tongue

Nose

A

B

D. O. Hebb (1949)

Page 3: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

The generalized Hebb rule:

where xi are the inputs

and y the output is assumed linear:

Results in 2D

jj

j

ii

xwy

yxdt

dw

Page 4: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

-2 -1 0 1 2-2

-1

0

1

2

x1

x 2 m

=/3

Example of Hebb in 2D

w

(Note: here inputs have a mean of zero)

Page 5: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

On the board:

• Solve simple linear first order ODE • Fixed points and their stability for non linear ODE.

Page 6: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

In the simplest case, the change in synaptic weight w is:

where x are input vectors and y is the neural response.

Assume for simplicity a linear neuron:

So we get:

Now take an average with respect to the distribution of inputs, get:

Δwi =ηx iy

y = w j

j

∑ x j

Δwi = η xixjwjj

∑ ⎛

⎝ ⎜

⎠ ⎟

jj

ijj

jjii wQwxxEwE

Δ ][][

Page 7: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

If a small change Δw occurs over a short time Δt then:(in matrix notation)

If <x>=0 , Q is the covariance function.

What is then the solution of this simple first order linear ODE ?

(Show on board)

www

Qdt

d

t

ΔΔ

Page 8: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

The change in synaptic weight w is:

where x are input vectors and y is the neural response.

Assume for simplicity a linear neuron:

So we get:

Mathematics of the generalized Hebb rule

))(( 00 yyxxw ii Δ

jj

jxwy

Δ

j jjjijjii xywxxxywxxw 0000

Page 9: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Δ

j jjjijjii xywxExxEywxxEwE 0000 ][][][][

Δ

j jjjiji xywxywQwE 0000][

ijji QxxE ][ ][ ixE

Taking an average of the the distribution of inputs

And using and

We obtain

Page 10: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

E[Δw ] =η Q − x0μJ[ ] W − y0(μ − x0) =η Q− k2J[ ]w − e^

k1

In matrix form

Where J is a matrix of ones, e is a unit vector in direction (1,1,1 … 1), and

or

Where

)( 001 xyk 02 xk

1

^

][ keE Δ wQw '

JkQQ 2'

Page 11: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

The equation therefore has the form

]ˆ[ 1' ekQ

dt

d w

w

If k1 is not zero, this has a fixed point, however it is usually not stable.

If k1=0 then have: ww 'Qdt

d

Page 12: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

The Hebb rule is unstable – how can it be stabilized while preserving its properties?

The stabilized Hebb (Oja) rule.

2'' )(/))(()1( Δww Δ iii wtwtw

NormalizeWhere |w(t)|=1

Appoximate to first order in Δw: (show on board)

Now insert

Get:

yxw ii Δ

)()()()1( '' twwtwwtwtwj

jjiiii ΔΔ

Page 13: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

jjjiii

jjjiiii

wxytwyxtw

tywxtwyxtwtw

'''

''''

)()(

)()()()1(

}y

))(()()1( 2'''' ytwyxtwtww iiiii Δ

Therefore

The Oja rule therefore has the form:

)( 2ywyxdt

dwii

i

Page 14: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

k kjjkjkiikk

i

k kjkjkjikkiii

i

wwxxwxxwdt

dw

wwxxwwxxywyxdt

dw

,

,

2 )(

Average

In matrix form:

Qw)w(wQww Tdt

d

Page 15: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Using this rule the weight vector converges tothe eigen-vector of Q with the highest eigen-value. It is often called a principal component or PCA rule.

•The exact dynamics of the Oja rule have been solved by Wyatt and Elfaldel 1995

•Variants of networks that extract several principal components have been proposed (e.g: Sanger 1989)

Page 16: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Therefore a stabilized Hebb (Oja neuron) carries out Eigen-vector, or principal component analysis (PCA).

-1 -0.5 0 0.5 1-1

-0.5

0

0.5

1

x1

x 2

=/3

Page 17: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Another way to look at this:

Where for the Oja rule:

At the f.p: where

So the f.p is an eigen-vector of Q.

The condition means that w is normalized.

Why? Could there be other choices for β?

))(( wQww

ydt

d

2)( yy

0dt

dw

Using this rule the weight vector converges tothe eigen-vector of Q with the highest eigen-value. It is often called a principal component or PCA rule.

wQw

= y 2

=y 2

Page 18: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Show that the Oja rule converges to the state |w^2|=1

The Oja rule in matrix form:

What is

Bonus question for H.W: The equivalence above, why does it prove convergence to normalization.

)( 2yydt

dwx

w

d | w2 |

dt= 2ηy2(1− | w2 |)

d | w2 |

dt=

d(wT ⋅w)

dt= 2wT ⋅

dw

dt

Page 19: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Show that the f.p of the Oja rule is such that the largest eigen-vector with the largest eigen-value (PC) is stable while others are not (from HKP – pg 202).

Start with:

Assume w=ua+εub where ua and ub are eigen-vectors with eigen-values λa,b

Qw)w(wQww Tdt

d

dt

ud

dt

du

dt

d ba )(w

)(()()( babababa uuuuuuuu )Q(Q T

Page 20: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

)(()()( babababa uuuuuuuudt

d )Q(Qw T

d(ua + εub )

dt=η λ aua + ελ bub − λ aua −ελ aub −ελ bua( ) +O(ε 2)

Get: (show on board)

Therefore:

That is stable only when λa> λb for every b.

abdt

d

Page 21: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Finding multiple principal components – the Sanger algorithm.

))((1

1iij

i

kkjkji

ij ywwyxydt

dw

Subtract projection onto accounted for subspace (Grahm-Schimdtt)

))((1

i

kkjkji

ij wyxydt

dw

Standard Oja Normalization

Page 22: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Homework 1: (due in 1/28) Implement a simple Hebb neuron with random 2D input, tilted at an angle, θ=30o

with variances 1 and 3 and mean 0. Show the synaptic weight evolution. (200 patterns at least)1b) Calculate the correlation matrix of the input data. Find the eigen-values, eigen-vectors of this matrix. Compare to 1a.1c) Repeat 1a for an Oja neuron, compare to 1b.+ bonus question above (another 25 pt)

Page 23: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

What did we learn up to here?

Page 24: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Visual Pathway

Area17

LGN

Visual Cortex

Retinalight electrical signals

•Monocular•Radially Symmetric

•Binocular•Orientation Selective

Receptive fields are:

Receptive fields are:

Page 25: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Re s

pon

se (

s pik

e s/s

e c)

Left Right

Tuning curves

0 180 36090 270

RightLeft

Page 26: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Orientation Selectivity

Binocular Binocular DeprivationDeprivation

NormalNormal

Adult

Eye-opening angle angle

Res

pon

se (

spik

es/s

ec)

Res

pon

se (

spik

es/s

ec)

Eye-opening

Adult

Page 27: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Monocular Monocular DeprivationDeprivation

NormalNormal

Left Right

% o

f ce

lls

group group

angleangleRes

pon

se (

spik

es/s

ec)

1 2 3 4 5 6 7

10

20

1 2 3 4 5 6 7

30

15

RightLeft

Rittenhouse et. al.

Page 28: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

First use Hebb/PCA with toy examplesthen used with more realistic examples

Page 29: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Aim get selective neurons using a Hebb/PCA rule

Simple example: ))(cos(1)( '' rrqrrQ

r r r r

Page 30: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Why?The eigen-value equation has the form:

Q can be rewritten in the equivalent form:

And a possible solution can be written as the sum:

)()()( ''1

1

' rwrwrrQdr

))sin()sin()cos()(cos(1)( ''' rrrrqrrQ

1

0 )sin()cos()(l

ll lrblraarW

Page 31: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Inserting, and by orthogonality get:

))sin()cos(()sin()cos(21

0110 lrblraarqbrqaa lll

So for l=0, λ=2, and for l=1, λ=q, for l>1 there is no solution.

So either w(r)= const with λ=2 or with λ=q.)sin()cos()( 11 rbrarw

Page 32: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Orientation selectivity from a natural environment:

The Images:

Page 33: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA
Page 34: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Natural Images, Noise, and Learning

image retinal activity

•present patches

•update weights

•Patches from retinal activity image

•Patches from noise

Retina

LGN

Cortex

Page 35: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Raw images: (fig 5.8)

Page 36: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Preprocessed images: (fig 5.9)

Page 37: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Monocular Monocular DeprivationDeprivation

NormalNormal

Left Right

% o

f ce

lls

group group

angleangleRes

pon

se (

spik

es/s

ec)

1 2 3 4 5 6 7

10

20

1 2 3 4 5 6 7

30

15

RightLeft

Rittenhouse et. al.

Page 38: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Binocularity – simple examples.

Q is a 2-eye correlation function.

What is the solution of the eigen-value equation:

mmQ

baba

21

21

1

1

2

1

1

1

2

1

mm

Page 39: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

In a higher dimensional case:

Qll, Qlr etc. are now matrixes.And Qlr=Qrl.

The eigen-vectors now have the form

rrrl

lrll

QQ

QQ2Q

m

m

m

m

2

1

2

1 21 mm

Page 40: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

In a simpler case

This implies Qll=Qrr, that is eyes are equivalent.And the cross eye correlation is a scaled version of the one eye correlation.

If: then:

with

QQ

QQ

2Q

mQm

m

m

m

m

2

1

2

1 21 mm

)1(2,1

Page 41: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Positive correlations (η=0.2)

Negative correlations (η=-0.2)

Hebb with lower saturation at 0

Page 42: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

Lets now assume that Q is as above for the 1Dselectivity example.

QQ

QQ

2Q

Page 43: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA
Page 44: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

With 2D space included

Page 45: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

2 partially overlapping eyes using natural images

Page 46: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

RightLeft

Orientation selectivity and Ocular Dominance

PCA

Left Eye

Right Eye

Right SynapsesLeft

Synapses

0

50

100

0

50

100

0

50

100

0

50

100

1 3 5Bin

No

. of

Cel

ls

Page 47: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

What did we learned today?

Page 48: Unsupervised learning The Hebb rule – Neurons that fire together wire together. PCA RF development with PCA

The Hebb rule is unstable – how can it be stabilized while preserving its properties?

The stabilized Hebb (Oja) rule.

This is has a fixed point at:

Where:

The only stable fixed point is for λmax