- product
Algorithm
Scribes :Denis
McInerney Sara Taheri Homework 2 : Out today Due
Fri Denis McInerney Scribes : Taheri Sara Out Homework 2 - - PowerPoint PPT Presentation
Algorithm Sum - product Lecture : Fri Denis McInerney Scribes : Taheri Sara Out Homework 2 today : Feb Due I Today Variables Marginal Discrete Exact over : Marginal Goal form Compute of the : =n;u p( ,
Algorithm
Scribes :Denis
McInerney Sara Taheri Homework 2 : Out today DueMarginal
p(
× ; =× ; ,Xj=×j )=×n;u§µ±
, PK ' ' × " , ' '÷
lj=x ;)Example
:Markov
Chain Busid Idea :Rearrange
Terms in Sum Pla , b , c , d ) = pc a 1 bl PC blc ) plc Id ) pcd ) D pcas = § , § , [ pcaiblplbic )p( cld )pccid
) pcd ) )) =§
pcaib ) f. ( b ) 8D " ) ÷{
Pcc 'd ) p 'd )Example
:Markov
Chain Naive Sum pca )=b¥
, § , a£ ..pl alblplbk
)p( cld ) ABC D 13 Rearranged Sun = [ pcaib ) ya ( b ) AB ABTBCTCD b= , B Va ( b ) =§
.,p(
bi e) yb ( c ) Jb ( 4 = § p ( c i a ) ya ( < ) { 1 Bc < D Question : What is the Computational Complexityf.
( a , b) fz ( b , a ) f , 1 c , d ) fa 1 d )f.
( a , b) fzl b. a ) f. ( c. d) f< , (d) Messages : Variable to Variable Message : µd→c( c) . pea , b. c ) = f. ( a. b ) fzlb ,c )§
f3(
c. d) fald ) pca , b ) ={
fzl b. c)fz ( b
, c) µb→f . ( b ) b → c b = µfz→c ( < )f.
( a , b) fz ( b , a ) fs ( c. d) f< , (d) Factor Graph ( singly{
afz
1 b. c. d) µIf,klµd→µld ) " µd→fzld ) t µfa→d( dl µf←→a( d) µf , . → dldkfshd ) Mfa → a (d) = § fn ( d. e) µe→ fale ) µe→fy( 4 = 1 µd→ fz ( d ) . Messages : Factor ←s Variable Mf . → 1 ^ >µfu→d÷
Pc a. b ) = f. ( a. b) {afz( b. c. d ) f > ( 4 fsld ) § fal d. elµfz→d(
a) = § . fzlb , ' , d) Messages : General Form µb →tl
¢f( Xf ) he ( × ) (factors that hecfl ( Variables that dependMµy→f(
y ) ( Sum ) { Xfrx } yesynecflix } Variable → Factor : µ×→f 1 × ) = M 9 e { necx )\fzµ9→× ( × ) ( Product )F.
E , # ) Fxgene
I flesh S Variable → Factor , µ × → f I x ) = M 9 c- ' new , { fgMg
→ x K ) ( Product )4 ss
< srd
< s s s pkl a M µt→×l× )f
fehecx ) Algorithm : Compute All Messages 1 . Pich any variable x 2 . Compute incoming messages 3 . ComputeBelief
Propagation : Pseudo( Binary
Variables ) Assume : EEdges
C x , f ) d OI [ f) Potentials T a t L a I finna f . woo fo , noooo def bp ( E , OI , x ) : s r r u a d µ = { } Messages b c e ^ a for f e I f i ( x , f) EE } : u v f- , ma f , maBelief
Propagation : Pseudo( Binary
Variables ) def in . sum ( µ,E , OI , f. × ) : d { y , , . . . yµ } = { y :( y , f) EE }s{ x } T at fs . ↳a• f. ↳. fe , ... for ye { y , , ... ,yµ } : 7 t r µ = inBelief
Propagation : Pseudo( Binary
Variables ) def in,E
, OI , x , f ) : d {Belief
Propagation : Pseudo( Binary
Variables ) Assume : EEdges
C x , f ) d OItag
messages{
µ = in{
for f e f f : I x , f) EE } : messages µ =Belief
Propagation : Pseudo( Binary
Variables ) defa .
r ,{
a µ[ xg.
, ...,gµ
} :g.
x ) a from in . sum return µBelief
Propagation : Pseudo( Binary
Variables ) def{
µ[f ,×][h]=[ # If](x=h , yih , ;yµ=hµ) b c e hi , . . , ,hµ(
|{ for
ye { y , ... . ibn } : a reverse µ = in}
can now compute z , ComputeAlgorithm
/ HMMS ) Factor Graph Generative Model f ' ,gk
,gk ,gf
' , h , ~ Discrete ( n ) ^ ^ ^ ^ htlht . , =L ~ Discrete ( Au ) 9 , 92 93 94 4 ^ ^ ^ Vtlht=h ~ Normal /µu,6u) 'y
9+(4,h+=hl
Forward
Pass ( outgoing messages ) = pivtl h+=h )µg+→htM
µtt . , → htlhl K = µg+→↳M [ftlhill
µn+ . ,→t+ll ) l = ' ↳ Aeu is d+ . , 1 l )Algorithm
/ HMMS ) Factor Graph Generative Model f , fz fz fg < < < 2 ( s < hi ~ Discrete ( n ) ^ ^ ^ ^ htlht . , =L ~ Discrete ( Ah ) 9 , 92 93 94 ^ ^ ^ ^ ✓ , |h+=h ~ Normal ( µu,6u ) Backward Pass ( Incoming Messages ) Btlh?
=Mf+→h+lH
=[
ft ( lih ) Mn++ , → fell ) = e§ ,ftllih
)µg++,→n
.!llµft+i→ht+
. " ' Ahl pi ✓ + + , 1 nt+,=l ) Bttll )Algorithm
/ HMMS ) ForwardPass di ( k ) = plv , 1h ,=h ) plh ,=h ) ( t=| ) dt 1 h ) = p(V+lh+=hl{
Aeudt . ,( l ) ( t > 1) Backward Pass Btlhl = 1 ( t=T ) B + 1h ) =§
Ane p(✓t+,1ht+,=l ) p++,ll ) ltctl Marginal s ytlh ) a 0+14 Ptlh ) = µf+ . ,→h+l↳µgµhd↳µfphd "Belief
Propagation : The Problem With Loops a b Directed Graph ; pca , b , c d ) a ( = Pla) p ( b 1 a) pcdla ) p ( CI b , d )Belief
Propagation : The Problem With Loops a b Directed Graph ; pca , b. c d ) a ( = Pla) p ( b 1 a ) p( dla ) p ( cl b. d)fz
Factor Graph ; a a. b f a. a. f Pla , b. c d ) 3 4 =f.
( a) fz ( a. b ) fs (Belief
Propagation : The Problem With Loopsfz
Factor Graph ; a a. b f a. a. f Pla , b. c d ) 3 4 =f.
( a) fz ( a. b ) fs (fz
[
( a , b. c) a a. bE
=f.
(a)fzl a. b)
[ f3l a. d) falls , c. d) d=l CLoopy
Belief Propagation Step 1 : Initialize Messages µ[ f. × ][ h ] = 1 Hefz
a a. b Step 2 : Update messagesfs
a. a.fu
for f € SCHEDULE : a c for × e nelf ) : Update µ×→t and µf→×Loopy
Belief Propagation Step 2 : Update messages for f e SCHEDULE : Repeat until for x e he ( f ) : convergencefz
a a. bSM
= necxl \{ f } 3 4 for he { o , 13 : a c µ×→tlkl = .Loopy
Belief Propagation Step 2 : Update messages for f E SCHEDULE : Repeat until my fi convergence f- z for x E he ( fl : a wa b Update In , → f and Mf → × f ma ma f ] 4 a c Problems . Unlike EM updates , Loopy BP dates are not guaranteed to converge → designing a good schedule is critical to performance{
afz
1 b. c. d) µIf,klµd→µld ) " µd→fzld ) t µfa→d( dl µf←→a( d) µf , . → dldkfshd ) Mfa → a (d) = § fn ( d. e) µe→ fale ) µe→fy( 4 = 1 µd→ fz ( d ) . Messages : Factor ←s Variable Mf . → 1 ^ >µfu→d÷
Pc a. b ) = f. ( a. b) {afz( b. c. d ) f > ( 4 fsld ) § fal d. elµfz→d(
a) = § . fzlb , ' , d) Messages : General Form µb →tl
¢f( Xf ) he ( × ) (factors that hecfl ( Variables that dependMµy→f(
y ) ( Sum ) { Xfrx } yesynecflix } Variable → Factor : µ×→f 1 × ) = M 9 e { necx )\fzµ9→× ( × ) ( Product )