6 1 linear transformations. 6 2 hopfield network questions

28
6 1 Linear Transformations

Post on 19-Dec-2015

224 views

Category:

Documents


7 download

TRANSCRIPT

Page 1: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

1

Linear Transformations

Page 2: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

2

Hopfield Network Questions

Page 3: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

3

Hopfield Network Questions

โ€ข The network output is repeatedly multiplied by the weight matrix W.

โ€ข What is the effect of this repeated operation?โ€ข Will the output converge, go to infinity, oscillate?โ€ข In this chapter we want to investigate matrix multiplication,

which represents a general linear transformation.

Page 4: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

4

Linear Transformations

A transformation consists of three parts:1. A set of elements X = {x i}, called the domain,

2. A set of elements Y = {y i}, called the range, and

3. A rule relating each x i รŽ X to an element y i รŽ Y.

A transformation is linear if:1. For all x 1, x 2 รŽ X, A (x 1 + x 2 ) = A (x 1) + A (x 2 ),

2. For all x รŽ X, a รŽ ร‚ , A (a x ) = a A (x ) .

Page 5: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

5

Example - Rotation

Is rotation linear?

ฮธ

Page 6: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

6

Example - Rotation

Is rotation linear?

1.

2.

Page 7: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

7

Example - Translation

Is translation linear?

๐’œ (๐’ณ)=๐’ณ+๐’ฏ๐’ณ๐’ณ+๐’ฏ

๐’ฏ๐’œ (๐’ณ1+๐’ณ2 )=๐’ณ1+๐’ณ2+๐’ฏ+

๐’œ (๐’ณ1 )+๐’œ (๐’ณ2 )=๐’ณ1+๐’ณ2+2๐’ฏ

Page 8: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

8

Matrix Representation - (1)

Any linear transformation between two finite-dimensional vector spaces can be represented by matrix multiplication.

Let {v1, v2, ..., vn} be a basis for X, and let {u1, u2, ..., um} be a

basis for Y.

Let :XยฎY

๐œ’=โˆ‘๐‘–=1

๐‘›

๐‘ฅ๐‘–๐‘ฃ ๐‘–

๐’œ (๐’ณ)=๐’ด๐’ด=โˆ‘

๐‘–=1

๐‘š

๐‘ฆ ๐‘–๐‘ข๐‘–

๐’œ(โˆ‘๐‘—=1

๐‘›

๐‘ฅ ๐‘— ๐‘ฃ ๐‘—)=โˆ‘๐‘–=1

๐‘š

๐‘ฆ๐‘–๐‘ข๐‘–

Page 9: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

9

Matrix Representation - (2)

Since is a linear operator,

Since the ui are a basis for Y,

(The coefficients a i j will make up the matrix representation of the transformation.)

โˆ‘๐‘—=1

๐‘›

๐‘ฅ ๐‘—๐’œ(๐‘ฃ๐‘—ยฟ)=โˆ‘๐‘–=1

๐‘š

๐‘ฆ ๐‘–๐‘ข๐‘–ยฟ

๐’œ (๐‘ฃ ๐‘— )=โˆ‘๐‘–=1

๐‘š

๐‘Ž๐‘–๐‘— ๐‘ข๐‘–

โˆ‘๐‘—=1

๐‘›

๐‘ฅ ๐‘—โˆ‘๐‘–=1

๐‘š

๐‘Ž ๐‘–๐‘—๐‘ข๐‘–=โˆ‘๐‘–=1

๐‘š

๐‘ฆ ๐‘–๐‘ข๐‘– โˆ‘๐‘–=1

๐‘š

๐‘ข๐‘–โˆ‘๐‘—=1

๐‘›

๐‘Ž๐‘–๐‘— ๐‘ฅ ๐‘—=โˆ‘๐‘–=1

๐‘š

๐‘ฆ ๐‘–๐‘ข๐‘–

Page 10: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

10

Matrix Representation - (3)

Because the u i are independent,

a 11 a 12 ยผ a 1 n

a 21 a 22 ยผ a 2 n

a m 1 a m 2 ยผ a m n

x 1

x 2

x n

y 1

y 2

y m

=This is equivalent to matrix multiplication.

โˆ‘๐‘–=1

๐‘š

๐‘ข๐‘–โˆ‘๐‘—=1

๐‘›

๐‘Ž๐‘–๐‘— ๐‘ฅ ๐‘—=โˆ‘๐‘–=1

๐‘š

๐‘ฆ ๐‘–๐‘ข๐‘– โˆ‘๐‘–=1

๐‘š

๐‘ข๐‘– (โˆ‘๐‘—=1

๐‘›

๐‘Ž๐‘–๐‘— ๐‘ฅ ๐‘—โˆ’ ๐‘ฆ๐‘–)=0

โˆ‘๐‘—=1

๐‘›

๐‘Ž๐‘–๐‘— ๐‘ฅ ๐‘—=๐‘ฆ ๐‘–

Page 11: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

11

Summary

โ€ข A linear transformation can be represented by matrix multiplication.

โ€ข To find the matrix which represents the transformation we must transform each basis vector for the domain and then expand the result in terms of the basis vectors of the range.

Each of these equations gives us one column of the matrix.

๐’œ (๐‘ฃ ๐‘— )=โˆ‘๐‘–=1

๐‘š

๐‘Ž๐‘–๐‘— ๐‘ข๐‘–

Page 12: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

12

Example - (1)

To find the matrix we need to transform each of the basis vectors.

We will use the standard basis vectors for both the domain and the range.

๐’œ (๐‘ฃ ๐‘— )=โˆ‘๐‘–=1

๐‘š

๐‘Ž๐‘–๐‘— ๐‘ข๐‘–

๐’œ (๐‘  ๐‘— )=โˆ‘๐‘–=1

2

๐‘Ž๐‘–๐‘— ๐‘ ๐‘–=๐‘Ž 1 ๐‘— ๐‘ 1+๐‘Ž 2 ๐‘— ๐‘ 2

Page 13: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

13

Example - (1)

We begin with s1:

This gives us the first column of the matrix.

If we rotate s1 counterclockwise by the angle we obtain

๐’œ (๐‘ 1 )=๐‘๐‘œ๐‘ ๐œƒ ๐‘ 1+๐‘ ๐‘–๐‘›๐œƒ๐‘ 2=โˆ‘๐‘–=1

2

๐‘Ž๐‘–1 ๐‘ ๐‘–=๐‘Ž11 ๐‘ 1+๐‘Ž21 ๐‘ 2

Page 14: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

14

Example - (1)

Next, we skew s2:

This gives us the second column of the matrix.

If we rotate s2 counterclockwise by the angle we obtain

๐’œ (๐‘ 1 )=โˆ’๐‘ ๐‘–๐‘›๐œƒ๐‘ 1+๐‘๐‘œ๐‘ ๐œƒ๐‘  2=โˆ‘๐‘–=1

2

๐‘Ž๐‘–1๐‘ ๐‘–=๐‘Ž12 ๐‘ 1+๐‘Ž22 ๐‘ 2

Page 15: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

15

Example - (1)

The matrix of the transformation is:

๐€=[c osฮธ โˆ’ sinฮธsin ฮธ cosฮธ ]

=

==Az

Page 16: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

16

Change of Basis

Consider the linear transformation A:XยฎY. Let {v1, v2, ..., vn}

be a basis for X, and let {u1, u2, ..., um} be a basis for Y.

The matrix representation is:

ยผยผ

a11

a12

ยผ a1 n

a21

a22

ยผ a2 n

am 1

am 2

ยผ am n

x1

x2

xn

y1

y2

ym

=

ยผ ยผ ยผ

๐œ’=โˆ‘๐‘–=1

๐‘›

๐‘ฅ๐‘–๐‘ฃ ๐‘– ๐’ด=โˆ‘๐‘–=1

๐‘š

๐‘ฆ ๐‘–๐‘ข๐‘–

๐’œ (๐’ณ)=๐’ด

๐€๐ฑ=๐ฒ

Page 17: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

17

New Basis Sets

Now letโ€™s consider different basis sets. Let {t1, t2, ..., tn} be a

basis for X, and let {w1, w2, ..., wm} be a basis for Y.

The new matrix representation is:

ยผยผยผ

a '11

a '12

ยผ a '1 n

a '21

a '22

ยผ a '2 n

a 'm 1

a 'm 2

ยผ a 'm n

x '1

x '2

x 'n

y '1

y '2

y 'm

=

ยผ ยผ

๐œ’=โˆ‘๐‘–=1

๐‘›

๐‘ฅ โ€ฒ ๐‘– ๐‘ก ๐‘– ๐’ด=โˆ‘๐‘–=1

๐‘š

๐‘ฆ โ€ฒ ๐‘–๐‘ค ๐‘–

๐€ โ€ฒ ๐ฑ โ€ฒ=๐ฒ โ€ฒ

๐’œ (๐’ณ)=๐’ด

Page 18: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

18

How are A and A' related?

Expand ti in terms of the original basis vectors for X.

Expand wi in terms of the original basis vectors for Y.

๐‘ก ๐‘–=โˆ‘๐‘—=1

๐‘›

๐‘ก ๐‘—๐‘–๐‘ฃ ๐‘—

๐‘ค ๐‘–=โˆ‘๐‘—=1

๐‘š

๐‘ค ๐‘—๐‘–๐‘ข ๐‘—

๐ญ ๐‘–=[๐‘ก 1 ๐‘–๐‘ก 2 ๐‘–โ‹ฎ๐‘ก ๐‘›๐‘–

]

๐ฐ ๐‘–=[ ๐‘ค1 ๐‘–๐‘ค2 ๐‘–โ‹ฎ

๐‘ค๐‘š๐‘–]

Page 19: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

19

How are A and A' related?

SimilarityTransform

๐ t=[๐ญ 1 ๐ญ 2 โ‹ฏ ๐ญ n ]๐w=[๐ฐ1 ๐ฐ 2 โ‹ฏ ๐ฐm ]

๐ฑ=๐‘ฅโ€ฒ 1๐ญ 1+๐‘ฅ โ€ฒ 2๐ญ 2+โ‹ฏ๐‘ฅ โ€ฒ n๐ญ n=๐ t ๐ฑ โ€ฒ

๐ฒ=๐‘ฆ โ€ฒ 1๐ฐ1+๐‘ฆ โ€ฒ 2๐ฐ 2+โ‹ฏ y โ€ฒ m๐ฐm=๐w ๐ฒ โ€ฒ

๐€๐ฑ=๐ฒ ๐€๐ t ๐ฑ โ€ฒ=๐w ๐ฒ โ€ฒ

[๐w โˆ’1๐€๐t ]๐ฑโ€ฒ=๐ฒ โ€ฒ

๐€ โ€ฒ ๐ฑโ€ฒ=๐ฒ โ€ฒ๐€โ€ฒ=[๐wโˆ’ 1๐€๐ t ]

Page 20: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

20

Example(2)

Consider a transformation A :๏ผฒ 3โ†’๏ผฒ 2 whose matrix representation relative to the standard basis sets is

Find the matrix for this transformation relative to the basis sets :

Page 21: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

21

Example(2)

Step 1 : form the matrices

Step 2 : Use

Page 22: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

22

Eigenvalues and Eigenvectors

Let A:XยฎX be a linear transformation. Those vectorsz รŽ X, which are not equal to zero, and those scalarsl which satisfy

A(z) = l z

are called eigenvectors and eigenvalues, respectively.

Page 23: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

23

Computing the Eigenvalues

๐€๐ณ=๐œ†๐ณ 0 0

๐ด=[๐‘๐‘œ๐‘  ๐œƒ โˆ’๐‘ ๐‘–๐‘›๐œƒ๐‘ ๐‘–๐‘›๐œƒ ๐‘๐‘œ๐‘ ๐œƒ ] =0

๐œ†2 โˆ’2๐œ†๐‘๐‘œ๐‘  ๐œƒ+cos 2ฮธ+sin 2ฮธ=๐œ†2โˆ’2๐œ†๐‘๐‘œ๐‘ ๐œƒ+1=0

๐œ†1=๐‘๐‘œ๐‘ ๐œƒ+ ๐‘–๐‘ ๐‘–๐‘›๐œƒ

๐œ†2=๐‘๐‘œ๐‘ ๐œƒโˆ’ ๐‘–๐‘ ๐‘–๐‘›๐œƒ

[โˆ’๐‘–๐‘ ๐‘–๐‘›๐œƒ โˆ’๐‘ ๐‘–๐‘›๐œƒ๐‘ ๐‘–๐‘›๐œƒ โˆ’๐‘–๐‘ ๐‘–๐‘›๐œƒ ] [๐‘ง 11

๐‘ง 21]=[00]๐ณ1=[๐‘ง 11

๐‘ง 21]=[1๐‘– ][๐‘–๐‘ ๐‘–๐‘›๐œƒ โˆ’๐‘ ๐‘–๐‘›๐œƒ๐‘ ๐‘–๐‘›๐œƒ ๐‘–๐‘  ๐‘–๐‘›๐œƒ ] [๐‘ง 11

๐‘ง 21]=[00]๐ณ 2=[๐‘ง 12

๐‘ง 2 2]=[ ๐‘–1]

Page 24: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

24

Diagonalization

Perform a change of basis (similarity transformation) usingthe eigenvectors as the basis vectors. If the eigenvalues aredistinct, the new matrix will be diagonal.

B z1 z2 zn=

z1 z2 zn{ , } Eigenvectors1 2 n{ , } Eigenvalues

n

ยผยผ

B1โ€“AB[ ]

l 1 0 ยผ 0

0 l 2 ยผ 0

0 0 ยผ l

=ยผ

Page 25: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

25

Example(3)

Diagonal Form:

๐€=[1 11 1] |[1โˆ’ ๐œ† 1

1 1โˆ’ ๐œ†]|=0

=(-2)=0 ๐œ†1=0๐œ†2=2

[1โˆ’ ๐œ† 11 1โˆ’ ๐œ†]๐ณ=[00 ]

๐œ†1=0

๐œ†2=2

[1 11 1] [๐‘ง 11

๐‘ง 21]=[00]

[โˆ’1 11 โˆ’1] [๐‘ง 12

๐‘ง 22 ]=[00 ]

๐ณ1=[๐‘ง 11๐‘ง 21]=[ 1

โˆ’1]๐ณ 2=[๐‘ง 12

๐‘ง 22]=[11]

๐€โ€ฒ=[๐โˆ’1๐€๐ ]=[ 12

โˆ’12

12

12

] [1 11 1][ 1 1

โˆ’ 1 1]=[0 00 2]

Page 26: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

26

Example - (4)

Take the skewing problem described previously, and find thenew matrix representation using the basis set {s1, s2}.

t 1 0.5s1 s2+=

t2 sโ€“ 1 s2+=

Bt t1 t20.5 1โ€“

1 1= = Bw Bt

0.5 1โ€“

1 1= =

t10.5

1=

t21โ€“

1=

(Same basis fordomain and range.)

Page 27: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

27

Example - (4)

A' Bw1โ€“ AB t 2 3 2 3

2โ€“ 3 1 31 tan

0 1

0.5 1โ€“

1 1= =

A' 2 3 tan 1+ 2 3 tan2โ€“ 3 tan 2โ€“ 3 tan 1+

=

A' 5 3 2 32โ€“ 3 1 3

=

For q = 45ยฐ:

A 1 1

0 1=

Page 28: 6 1 Linear Transformations. 6 2 Hopfield Network Questions

6

28

Example - (4)

Try a test vector: x 0.5

1= x' 1

0=

y' A'x' 5 3 2 32โ€“ 3 1 3

1

0

5 32โ€“ 3

= = =y Ax 1 1

0 1

0.5

1

1.5

1= = =

y' B 1โ€“ y 0.5 1โ€“

1 1

1โ€“1.5

1

2 3 2 32โ€“ 3 1 3

1.5

1

5 32 3โ€“

= = = =

Check using reciprocal basis vectors: