diffusion framework and spectral transformmilos/courses/cs3750-fall2011/lectures/class18.pdfsaeed...

21
Diffusion Framework and Spectral Transform Saeed Amizadeh [email protected] 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents Introduction Random Walk on Graphs Multiscale Random Walk Diffusion Distance Diffusion Map Approximation Spectral Transform Continuoustime Diffusion Resistance Distance 11/7/2011 Advanced Topics in ML (CS 3750) 2

Upload: others

Post on 15-Sep-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Diffusion Framework and Spectral Transform

Saeed Amizadeh

[email protected]

11/7/2011 Advanced Topics in ML (CS 3750) 1

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 2

Page 2: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Underestimation of distance

11/7/2011 Advanced Topics in ML (CS 3750) 3

Not a good distance metric!

Not a good distance metric!

Overestimation of distance

11/7/2011 Advanced Topics in ML (CS 3750) 4

The two images are close while their Euclidean

distance is large!

The two images are close while their Euclidean

distance is large!

Page 3: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Why diffusion framework?

11/7/2011 Advanced Topics in ML (CS 3750) 5

Noise sensitivity

11/7/2011 Advanced Topics in ML (CS 3750) 6

Page 4: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 7

Random Walk on Graphs

• Let W be the similarity matrix on the graph, the transition from node x to node y is defined as:

p1(y | x) =w(x,y)d(x)

d(x) = w(x,z)z∈N (x )∑

11/7/2011 Advanced Topics in ML (CS 3750) 8

P = pij = p1(x j | xi)[ ]n×n

Page 5: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Some properties of RW

• Asymptotic distribution

• The absolute value of the eigenvalues of P are between 0 and 1 with largest one equal to 1.

• The eigenvectors:

11/7/2011 Advanced Topics in ML (CS 3750) 9

π ∞(y) = limt →∞

pt (y | x) =d(y)

d(z)z

PTφi = λiφi and Pψ i = λiψ i

ψi(x) =φi(x)φ0(x)

Some properties of RW

• The eigenvectors of P are bi‐orthogonal:

• Normalization:

11/7/2011 Advanced Topics in ML (CS 3750) 10

φkTψl = δ(k,l)

φl 1/φ0

2 =φl

2(x)φ0(x)

=1, ψl φ0

2 =x

∑ ψl2(x)φ0(x)

x∑ =1

Page 6: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Forward Diffusion Process

• If the probability vector πt(.) represents the distribution of random walker at time t, we have:

• Corollary:

π t +1(x) = p1(x | y)π t (y)y

π t +1 = PTπ t

π ∞ = PTπ ∞ ⇒ π ∞ = φ0

11/7/2011 Advanced Topics in ML (CS 3750) 11

Backward Diffusion Process

• If gt(.) is a real‐valued function defined on the graph at time t, gt+1(.) is the average of gt(.) at time t+1:

• Corollary: g∞(.) is the smoothest function (i.e. the constant function)

gt +1(x) = p1(y | x)gt (y)y

gt +1 = Pgt

g∞ = Pg∞ ⇒ g∞ =ψ0 =1

11/7/2011 Advanced Topics in ML (CS 3750) 12

Page 7: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Link to Normalized Laplacian

• The transition matrix is closely related to the asymmetric normalized Laplacian:

dii = w(x,y)y ∈N(x )∑

P = D−1W ,Lrw = I − D−1W = I − P

11/7/2011 Advanced Topics in ML (CS 3750) 13

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 14

Page 8: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

T‐step Diffusion Processes

• We can generalize the forward and backward processes:

π t0 + t = PT PT ...PTπ t0 = (P(t ))T π t0

gt0 + t = P.P....P.gt0 = P( t )gt0

Ψ = ψ0 |ψ1 | ... |ψn−1[ ], Φ = φ0 | φ1 | ... | φn−1[ ]Λ = Λ ii = λi[ ]n×n

P = ΨΛΦT ⇒ P(t ) = ΨΛ(t )ΦT

P(t ) = λxt φx

T .ψxx

∑11/7/2011 Advanced Topics in ML (CS 3750) 15

What does it do?

• The smaller eigenvalues decay:

11/7/2011 Advanced Topics in ML (CS 3750) 16

Page 9: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 17

Diffusion Distance

• The diffusion distance between nodes x and zat scale t is defined as:

11/7/2011 Advanced Topics in ML (CS 3750) 18

Dt2(x,z) = pt (. | x) − pt (. | z) 1/φ0

2 =pt (y | x) − pt (y | z)( )2

φ0(y)y∑

Page 10: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Interpretation

11/7/2011 Advanced Topics in ML (CS 3750) 19

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 20

Page 11: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Diffusion Map

• The diffusion map of point x at scale with dimensionality q is defined as:

Ψf : x →

λ1tψ1(x)

λ2t ψ2(x)

λqt ψq (x)

11/7/2011 Advanced Topics in ML (CS 3750) 21

Approximating Diffusion Dist.

• By replacing

• in

• we get:

p(t )(x,y) = λzt φz

T (x).ψz(y)z

Dt2(x,z) = λy

2t (ψy (x) −ψy (z))2

y∑

≈ λy2t (ψy (x) −ψy (z))2

y=1

q

∑ = Ψt (x) − Ψt (z) 2

11/7/2011 Advanced Topics in ML (CS 3750) 22

The Euclidean distance

The Euclidean distance

Dt2(x,z) = pt (. | x) − pt (. | z) 1/φ0

2 =pt (y | x) − pt (y | z)( )2

φ0(y)y∑

Page 12: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Embedded Space for Image Data

11/7/2011 Advanced Topics in ML (CS 3750) 23

Handwritten Digits

11/7/2011 Advanced Topics in ML (CS 3750) 24

Page 13: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Words in 2D

11/7/2011 Advanced Topics in ML (CS 3750) 25

Clusters = Topics

11/7/2011 Advanced Topics in ML (CS 3750) 26

Page 14: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 27

T‐step Random Walk Kernel

• The kernel in the embedded space is:

• One can define more general kernel by letting f to be any increasing function

Kt (x,y) = Ψt (x),Ψt (y) = λz2tψz (x)

z∑ ψz (y)

= ΨΛ2tΨT = Ψf (Λ)ΨT

K f (x,y) = Ψf (x),Ψf (y) = f (λz )ψz(x)z

∑ ψz (y) = Ψf (Λ)ΨT

11/7/2011 Advanced Topics in ML (CS 3750) 28

Page 15: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

The General Mapping

• The induced mapping is:

• The corresponding distance is:

Ψf : x →

f (λ1)ψ1(x)

f (λ2)ψ2(x)

f (λq )ψq (x)

Df2 (x,z) = (ex − ez )

T K f (ex − ez ) = Ψf (x) − Ψf (z)2

11/7/2011 Advanced Topics in ML (CS 3750) 29

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 30

Page 16: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Diffusion Kernel

• The Diffusion (Heat) Kernel reads:

• Informally, this process diffuses the local similarity H to obtain the global similarity K after time t.

∂∂t

Kt (x, y) = H.Kt (x, y)

K0(x, y) = δ(x, y)

11/7/2011 Advanced Topics in ML (CS 3750) 31

The Exponential Family

• Solving the differential equation, we get:

• Example: for the continuous Laplacian operator H=Δ, k is the Gaussian kernel.

∂∂t

Kt (x,y) = H.Kt (x, y) Kt = etH = limn →∞

I +tHn

n

K0(x, y) = δ(x,y)

11/7/2011 Advanced Topics in ML (CS 3750) 32

Page 17: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Continuous Diffusion on Discrete Graphs

• For discrete graphs, we have

• Such that:

H = −L

L = U(I − Λ)UT ⇒ Kt = etH = e− tL = Ue− t(I −Λ )UT

µi = e−t(1−λi ) = f (λi)This is a spectral

transform!This is a spectral

transform!

11/7/2011 Advanced Topics in ML (CS 3750) 33

How related to random walk?

• Continuous Diffusion Kernel is the limit of Lazy Random Walk:

11/7/2011 Advanced Topics in ML (CS 3750) 34

′ p ij = t0∆t.pij , ′ p ii =1− t0∆t.pijj ∈N( i)∑ =1− t0∆t, N =1/∆t

′ P N = (1− t0∆t)I + t0∆t.P( )1/ ∆t = I + t0∆t.(−Lrw )( )1/ ∆t

where Lrw = I − P

lim∆t →0

′ P N = lim∆t →0

I +t0(−Lrw )

1/∆t

1/ ∆t

= exp(−t0Lrw )

Page 18: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Contents

• Introduction• Random Walk on Graphs• Multi‐scale Random Walk• Diffusion Distance• Diffusion Map Approximation• Spectral Transform• Continuous‐time Diffusion• Resistance Distance

11/7/2011 Advanced Topics in ML (CS 3750) 35

The Circuit Analogy

• Let G be a circuit with:

wij = cij =1rij

similarity ↔ conductancedistance ↔ resistancefunction on graph ↔ node potential

11/7/2011 Advanced Topics in ML (CS 3750) 36

Page 19: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

The Kirchhoff’s laws

• If yij is the current from node i to j and Y is the total current from source a to sink b, then

• If C is a cycle in the circuit with ordered edges i j

yij =Y if i = a−Y if i = b0 otherwise

j ∈N( i)∑

yijrij = 0 = (vi − v j )i→ j∑

i→ j∑

11/7/2011 Advanced Topics in ML (CS 3750) 37

The Effective Resistance

• The effective resistance between a and b with the total current Y is defined as:

• Theorem:

Rab =va − vb

Y

Rab = (ea − eb )T L+(ea − eb )if L = UΛUT ⇒ L+ = Uf (Λ)UT

where f (x) =1/ x x ≠ 00 x = 0

11/7/2011 Advanced Topics in ML (CS 3750) 38

Page 20: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Resistance as Distance

• Comparing

• The spectral transform is:

Rab = (ea − eb )T L+ (ea − eb )Df

2(a,b) = (ea − eb )T K f (ea − eb )

f (x) =1/ x x ≠ 00 x = 0

11/7/2011 Advanced Topics in ML (CS 3750) 39

Some properties

• R is a distance metric

• R is a non‐increasing function of edge weights

• R is a lower bound on the geodesic distance

Rab ≤ dab

11/7/2011 Advanced Topics in ML (CS 3750) 40

Page 21: Diffusion Framework and Spectral Transformmilos/courses/cs3750-Fall2011/lectures/class18.pdfSaeed Amizadeh saeed@cs.pitt.edu 11/7/2011 Advanced Topics in ML (CS 3750) 1 Contents •

Relation to Random Walk

• Let Tab denote the number of transitions (i.e. discrete time) that take random walker from ato b. The average commute time between a and b is defined as:

• Theorem:

Cab = E(Tab ) + E(Tba )

Rab =Cab

dii

∑11/7/2011 Advanced Topics in ML (CS 3750) 41

Thank You!

11/7/2011 Advanced Topics in ML (CS 3750) 42