26
1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription for evolving the state of a system forward in time ) ......, , , ( ...... ) ......, , , ( ) ......, , , ( 2 1 2 1 2 2 2 1 1 1 N N N N N x x x F dt dx x x x F dt dx x x x F dt dx = = = Continuous System: Time is a continuous variable or = F(x, μ μ μ) x∈ℜ N x With x U ⊂ℜ N , μ μ μ V ⊂ℜ P where U and V are open sets in N and P Neurodynamics Discrete System: Time is a discrete integer-valued variable x N+1 = F(x N ) where x is a N dimensional vector. Given an initial state x 0 , we can generate an orbit of the discrete time system x 0 , x 1 , x 2 , .... by iterating the map. For example: x N+1 = -0.5x N

Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

Embed Size (px)

Citation preview

Page 1: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

1

NeurodynamicsDynamical System:

A dynamical system may be defined as a deterministic mathematical prescription for

evolving the state of a system forward in time

)......,,,(

......

)......,,,(

)......,,,(

21

2122

2111

NNN

N

N

xxxFdt

dx

xxxFdt

dx

xxxFdt

dx

=

=

=

Continuous System: Time is a continuous variable

or = F(x, µµµµ) x∈ℜN •x

With x ∈ U ⊂ ℜN , µµµµ ∈ V ⊂ ℜP

where U and V are open sets in ℜN and ℜP

Neurodynamics

Discrete System: Time is a discrete integer-valued variable

xN+1 = F(xN)

where x is a N dimensional vector. Given an initial state x0, we can generate an orbit of the discrete time system

x0, x1, x2, .... by iterating the map.

For example: xN+1 = -0.5xN

Page 2: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

2

y = x - xf(t)

= F(xf(t)) + DF(xf(t))y + Ο(|y|2) •x

•••+= yxx )(tf

= F(xf(t)), •

)(tfx

= DF(xf(t))y + Ο(|y|2) •y

Continuous Dynamical Systems

For the dynamical system:

= F(x, µµµµ) x∈ℜN •x (1)

Let (2)

Where xf(t) is a fixed point.

Then,

Using the Taylor expanding aboutxf(t) gives

Using the factor that we get

(3)

(4)

= DF(xf(t))y•y

Ayy =•

Continuous Dynamical Systems

(5)

(6)

Since y is small, so it is reasonable that the stability of the original system could be answered by studying the associated linear system:

Since DF(xf(t)) = DF(xf), then

(7)

0)()( yy x tDF fet =Then,

Page 3: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

3

Continuous Dynamical Systems

( ) ( )

( ) ( )

∂∂

∂∂

∂∂

∂∂

==xx

xx

xA

n

nn

n

x

f

x

f

x

f

x

f

DF

...

.........

...

)(

1

1

1

1

A is called a Jacobian matrix (partial derivatives):

∑=

=N

kkkk teAt

1

)exp()( λy

Ae = λe

We have an eigenvalue equation:

(8)

(9)

∑=

=N

kkk eAy

10whereAk are determined from the initial condition:

λk (k = 1, 2, ......, N) are eigenvalues of A

Continuous Dynamical Systems

Page 4: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

4

Definition 1: (Lyapunov stability) xf(t) is said to be stable or

Lyapunov stable, if given ε > 0, there exists a δ = δ(ε) > 0 such

that, for any other solution, y(t), of the system (2-2), satisfying

|xf(t0) - y(t0)| < δ, then |xf(t) - y(t)| < ε for t > t0, t0 ∈ ℜ.

Definition 2: (asymptotic stability) xf(t) is said to be asymptotic

stable if it is lyapunov stable and if there exists a constant b > 0

such that if |xf(t0) - y(t0)| < b, then |xf(t) - y(t)| = 0 when t → ∞.

Continuous Dynamical Systems

Definition 3: Let x = xf be a fixed point of = F(x), then,xf is

called a hyperbolic fixed point if none of the eigenvalues of

DF(xf) have zero real part. (a hyperbolic fixed point of a

N-dimensional map is defined as: none of its eigenvalues have

absolute one)

Stability of Equilibrium State

Theorem 1: Suppose all of the eigenvalues of A in Eqn.

(7)

have negative real parts. Then the equilibrium solutionxf

of the nonlinear flow defined by Eqn.(1) is asymptotically

stable.

Theorem 2: if one of the eigenvalues of A has a positive real

part, the fixed point is unstable

Page 5: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

5

Stability of Equilibrium State

For a two-dimensional continuous system, the stability of a fixed point can be classified by its eigenvalues of theJacobian matrix evaluated at a fixed point in three types:

• The eigenvalues are real and have the same sign. If theeigenvalues are negative, this is a stable point; if theeigenvalues are positive, this is a unstable point.• The eigenvalues are real and have opposite signs. In this case, there is a one-dimensional stable manifold and a one-dimensional unstable manifold. This fixed point is called a unstable saddle point.• The eigenvalues are complex conjugates. If the real part ofthe eigenvalues is negative, this is a stable spiral or a spiral

sink. If the real part is positive, this is an unstable spiral or a spiral source. If the real parts are zero, then this is a center.

Stability of Equilibrium State

y

x

y

x

Page 6: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

6

Stability of Equilibrium State

y

x

Stability of Equilibrium State

dx/dt = x - x3/3 - y + I(t)dy/dt = c(x + a - by)

(a = 0.7, b = 0.8, c = 0.1)

−−−

=bcc

xJ

11 2

λ1, 2 = -[(bc - 1 + x2) ± ((x2 -1 + bc)2 - 4c)1/2] /2

Page 7: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

7

Stability of Equilibrium State

•For 0 < A0 < 0.341, the eigenvalues are complex and the real part

is negative and hence the fixed point (xp, yp) is a stable focus.

•At A0 = 0.341, the real part of eigenvalues vanishes and the

system undergoes a Hopf bifurcation.

•For 0.341 < A0 < 1.397, the real part is positive and the fixed

point is unstable, one can expect a stable limitcycle in this range.

•At A0 = 1.397 the real part of the eigenvalues vanishes and the

system undergoes Hopf bifurcation.

•For A0 > 1.397, the real part is negative, the system’s solution is

again a stable fixed point.

•For sufficiently large A0, the system points diverge to infinity.

Stability of Equilibrium State

Lyapunov Function

According to the definition of stability it would be

sufficient to find a neighborhood U of xf for which

orbits starting in U remain in U for positive times.

This condition would be satisfied if we could show

that the vector field is either tangent to the boundary

of U or pointing inward towardxf.

Page 8: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

8

Stability of Equilibrium StateLyapunov Function

Theorem: Consider the following continuous dynamical system

= F(x) x∈ℜN

Let xf be a fixed point and let V: U→ℜ be a continuous

differentiable function defined on some neighborhood U of xf

such that

i) V(xf) = 0 and V(x) > 0 if x ≠ xf.

ii) in U -{ xf}.

Thenxf is stable. Moreover, if

iii) in U -{ xf}.

Thenxf is asymptotically stable.

0)( ≤•

xV

0)( <•

xV

•x

Stability of Equilibrium State

Lyapunov Function

),(

),(

yxgy

yxfx

=

=•

(x, y) ∈ ℜ2

Let (xf, yf) be a fixed point. Let V(x, y) be the scalar-valued

function, V: ℜ2 →ℜ1, with V(xf, yf) = 0, and the locus of

points satisfying V(x, y) = C = constant form closed curves

for different values of C encircling (xf, yf) with V(x, y) > 0

in a neighborhood of (xf, yf).

Page 9: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

9

Stability of Equilibrium StateLyapunov Function

V = C3

V = C2

(xf, yf)

V = C1

Stability of Equilibrium StateLyapunov Function

The gradient of V, ∇V, is a vector perpendicular to the

tangent vector along each curve of V which points in

the direction of increasing V. So if the vector field were

always to be either tangent or pointing inward for each

of these curves surrounding (xf, yf), we would have

0 ,x · y) V(x, ≤

∇••y

Page 10: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

10

Stability of Equilibrium StateLyapunov Function

∇V

∇V∇V

∇V

∇V∇V

∇V

V

(xf, yf)

Discrete Dynamical Systems

Linearized Stability of Equilibrium Solutions

fixed point (stationary point or equilibrium point):is an equilibrium solution of a point xf ∈ℜN such thatxf = F(xf(t)).

Example 1 (logistic map) : xn+1 = f(xn) = xn(1-xn)

There is only one fixed point: x = 0

Example 2 (logistic map): xn+1 = f(xn) = 2xn(1-xn)There are two fixed points: x = 0 and x = 0.5

Page 11: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

11

Discrete Dynamical Systems

Linearized Stability of Equilibrium Solutions

Example 3 (Henon map):

There are two fixed points: (x = 1, y = 1) and (x = -1, y = -1)

+−=

+

+

n

nn

n

n

x

byxa

y

x 2

1

1

a = 1, b = 1

Stability of Equilibrium State

xN = xf + yN

yN+1 = DF(xf)yN + Ο(yN2)

yN+1 = AyN

Ae = λe

∑=

+ =N

k

nkkkn eAy

11 λ

Conclusion:directions corresponding to |λk| > 1 are unstable; directions corresponding to |λk| < 1 is stable.

(10)

(11)

(12)

(13)

(14)

Page 12: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

12

Discrete Dynamical Systems

Linearized Stability of Equilibrium Solutions

Example 1 (logistic map) : xn+1 = f(xn) = xn(1-xn)

There is only one fixed point: x = 0

Since f’(x)|x = 0 = 1 - 2x|x = 0 = 1, then x = 0 is a center

Example 2 (logistic map): xn+1 = f(xn) = 2xn(1-xn)There are two fixed points: x = 0 and x = 0.5

Since f’(x)|x = 0 = 2 - 4x|x = 0 = 2, then x = 0 is unstableSince f’(x)|x = 0.5= 2 - 4x|x = 0.5= 0, then x = 0 stable (super-stable)

Discrete Dynamical Systems

Linearized Stability of Equilibrium Solutions

Example 3 (Henon map):

There are two fixed points: (x = 1, y = 1) and (x = -1, y = -1)

+−=

+

+

n

nn

n

n

x

byxa

y

x 2

1

1

( )

−=

01

12xDF x

For (x=1 , y = 1) ,21,21 21 −−=+−= λλ unstable

For (x=-1 , y = -1) ,21,21 21 −=+= λλ unstable

a = 1, b = 1

Page 13: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

13

Stability of Equilibrium State

Exercises:

1) Let l(x) = ax+b, where a and b are constants. Foe which

values of a and b does l have na attracting fixed point? A

repelling fixed point?

2) Let f(x) = x- x2. Show that x = 0 is a fixed point of f, and

described the dynamical behavior of points near 0.

3) For each of the following linear maps, decide whether

the origin is a sink, source, or saddle.

−−

6.14.0

4.24.0

43

41

211

31

304

Stability of Equilibrium State

Exercises:

4) Let g(x, y) = (x2-5x+y, x2). Find and classify the fixed

points of g as sink, source, or saddle.

5) Let f(x, y) = (sin(π/3)x, y/2). Find all fixed points and

their stability. Where does the orbit of each initial value go?

6) Find

−−∞→ 9

6

5.32

85.4lim

n

n

Page 14: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

14

Hopfield Models

General Idea: Artificial Neural Networks ↔ Dynamical Systems

Initial Conditions Equilibrium Points

Continuous Hopfield Model

i

N

jjiji

iii I

jtxw

R

tx

dt

tdxC +

=+−= ∑

1))((

)()( ϕ

a) the synaptic weight matrix is symmetric,wij = wji, for all i and j.

b) Each neuron has a nonlinear activation of its own, i.e.yi = ϕi(xi).

Here, ϕi(•) is chosen as a sigmoid function;

c) The inverse of the nonlinear activation function exists, so we may

write x = ϕi-1(y).

Page 15: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

15

Continuous Hopfield Model

∑∑ ∑ ∫∑== =

=

−+−=N

iii

N

j

N

i

x

iii

N

ijiij yIdxy

RyywE

i

11 10

1

1

)(1

2

1 ϕ

Lyapunov Function:

∑ ∑= =

+−−=

N

i

iN

ji

i

ijij dt

dyI

R

xyw

dt

dE

1 1

0

)(

)(

1

12

1

1

−=

−=

=

=

N

i

iiii

iN

i

iii

dt

yd

dt

dyC

dt

dy

dt

ydC

ϕ

ϕ

Discrete Hopfield Model

• Recurrent network• Fully connected• Symmetrically connected (wij = wji, or W = WT)• Zero self-feedback (wii = 0)• One layer • Binary States:

xi = 1 firing at maximum valuexi = 0 not firing

• or Bipolar xi = 1 firing at maximum valuexi = -1 not firing

Page 16: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

16

Discrete Hopfield Model

Discrete Hopfield Model (Bipole)

=−

<−−

>−

=

ijijiji

ijijij

ijijij

i

xwx

xw

xw

x

0

01

01

θ

θ

θ

Transfer Function for Neuron i:

x = (x1, x2 ... xN): bipole vector, network state. θi : threshold value of xi.

−= ∑

≠ ijijiji xwx θsgn ( )Θ−= Wxx sgn

Page 17: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

17

Discrete Hopfield Model

E w x x xij i j i iij ii

= − +∑∑∑≠

1

E w x xij i jj ii

= −≠∑∑

1

2

For simplicity, we consider all threshold θi = 0:

Energy Function:

Discrete Hopfield Model

Learning Prescription (Hebbian Learning):

Pattern ξs = (ξs1, ξs

2, ..., ξsn), where ξs

i take value 1 or -1

∑=

=M

jiij Nw

1,,

1

µµµ ξξ

{ ξµ µ = 1, 2, ..., M}: M memory patterns

In the matrix form:

IξξW MN

MT −= ∑

=1

1

µµµ

Page 18: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

18

Discrete Hopfield Model

Energy function is lowered by this learning rule:

∑∑

∑∑∑∑

≠≠

−⇔

−=−=

i ijji

i ijjiij

i ijjiij wxxwE

2,

2,

,,

2

1

2

1

2

1

µµ

µµ

ξξ

ξξ

Discrete Hopfield Model

Pattern Association (asynchronous update):

( ) ( )

∑∑∑∑

≠≠

∆−⇔

++−=

−+=∆

ijjiji

i ijjiij

i ijjiij

k

xwkx

xkxwxkxw

kEkEE

)(

2

11

2

1

)()1(

∆∆∆∆Ek ≤≤≤≤ 0

Page 19: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

19

Discrete Hopfield Model

Example:

Consider a network with three neurons, the weight matrix is:

−−−

−=

022

202

220

3

1W

3

2−

3

2−3

2

3

2

3

2−

3

2−

1

2 3

Page 20: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

20

(1, 1, 1)

(1, -1, 1)stable

(1, -1, -1)(-1, -1, -1)

(-1, 1, -1)stable

(-1, 1, 1)

(-1, -1, 1)

(1, 1, -1)

The model with three neurons has two fundamental memories (-1, 1, -1)T and (1, -1, 1)T

−=

−−−

−=

4

4

4

3

1

1

1

1

022

202

220

3

1Wx

[ ] xWx =

−=1

1

1

sgn

State (1, -1, 1)T:

A stable state

Page 21: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

21

−=

−−−

−=

4

4

4

3

1

1

1

1

022

202

220

3

1Wx

[ ] xWx =

−=

1

1

1

sgn

State (-1, 1, -1)T:

A stable state

−=

−−−

−=

0

4

0

3

1

1

1

1

022

202

220

3

1Wx

[ ] xWx ≠

−=1

1

1

sgn

State (1, 1, 1)T:

An unstable state. However, it converges to its neareststable state (1, -1, 1)T

Page 22: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

22

−=

−−−

−=

4

0

0

3

1

1

1

1

022

202

220

3

1Wx

[ ]

−=

1

1

1

sgn Wx

State (-1, 1, 1)T:

An unstable state. However, it converges to its neareststable state (-1, 1, -1)T

[ ] [ ]

−−−

−=

−−−

−+−−

−=

022

202

220

3

1

100

010

001

3

2111

1

1

1

3

1111

1

1

1

3

1W

Thus, the synaptic weight matrix can be determined bythe two patterns:

Page 23: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

23

Computer Experiments

Significance of Hopfield Model

1) The Hopfield model establishes the bridge between

various disciplines.

2) The velocity of pattern recalling in Hopfield models

is independent on the quantity of patterns stored in

the net.

Page 24: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

24

Limitations of Hopfield Model

2) Spurious memory;

3) Auto-associative memory;

4) Reinitialization

5) Oversimplification

1) Memory capacity;

The memory capacity is directly dependent on the number

of neurons in the network. A theoretical result is

N

Np

log2<

When N is large, it is approximately

p = 0.14N

Problema de Caixeira Viajante

• Buscar um caminho mais curto entre n cidades visitando

cada cidade somente uma vez e voltando a cidade de

partida.

• Um problema clássico de otimização combinatório;

• Algoritmos para encontrar uma solução exato são

NP-difíceis

Page 25: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

25

Problema de Caixeira Viajante

( )

++

−+

−=

∑∑∑

∑ ∑∑ ∑

= = =−+

= == =

n

iijij

n

j

n

kjkjk

n

j

n

iij

n

i

n

jij

dxxxW

xxW

E

1 1 111

2

1

2

11

2

1

1

2

112

11

0

ini

ini

xx

xx

==

+dij: distancia entre cidade i e j

Cidade/Posição 1 2 3 4

1 1 0 0 0

2 0 0 1 0

3 0 0 0 1

4 0 1 0 0

xij: Output do neurônio (i, j)

N cidades, N2 neurônios

Page 26: Neurodynamics - wiki.icmc.usp.brwiki.icmc.usp.br/images/4/4d/Hopfield.pdf · 1 Neurodynamics Dynamical System: A dynamical system may be defined as a deterministic mathematical prescription

26

( ) ( ) ( ) ( ) ( ) ( )

+

+−

+−+=+ ∑ ∑∑ ∑

≠ ≠−+

≠ ≠311211 WtxdtxdWtxtxWtkyty

N

ik

N

ikkjikkjik

N

ji

N

ikkjijijij α

( ) ( ) εtyij ijetx −+

=1

1

( ) ( ) ( )

>= ∑

otherwise

Ntxtxifftx

lkklij

ij

0

1 2

,