6 1 linear transformations. 6 2 hopfield network questions
Post on 19-Dec-2015
224 views
TRANSCRIPT
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.
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 ) .
6
5
Example - Rotation
Is rotation linear?
ฮธ
6
6
Example - Rotation
Is rotation linear?
1.
2.
6
7
Example - Translation
Is translation linear?
๐ (๐ณ)=๐ณ+๐ฏ๐ณ๐ณ+๐ฏ
๐ฏ๐ (๐ณ1+๐ณ2 )=๐ณ1+๐ณ2+๐ฏ+
๐ (๐ณ1 )+๐ (๐ณ2 )=๐ณ1+๐ณ2+2๐ฏ
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
๐
๐ฆ๐๐ข๐
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
๐
๐ฆ ๐๐ข๐
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
๐
๐๐๐ ๐ฅ ๐=๐ฆ ๐
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
๐
๐๐๐ ๐ข๐
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
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
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
6
15
Example - (1)
The matrix of the transformation is:
๐=[c osฮธ โ sinฮธsin ฮธ cosฮธ ]
=
==Az
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
๐
๐ฆ ๐๐ข๐
๐ (๐ณ)=๐ด
๐๐ฑ=๐ฒ
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
๐
๐ฆ โฒ ๐๐ค ๐
๐ โฒ ๐ฑ โฒ=๐ฒ โฒ
๐ (๐ณ)=๐ด
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 ๐โฎ
๐ค๐๐]
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 ]
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 :
6
21
Example(2)
Step 1 : form the matrices
Step 2 : Use
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.
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]
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
=ยผ
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]
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.)
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=
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: