Download presentation
Presentation is loading. Please wait.
Published byDale Morrison Modified over 9 years ago
1
Discrete Optimization Lecture 1 M. Pawan Kumar pawan.kumar@ecp.fr Slides available online http://cvn.ecp.fr/personnel/pawan/
2
Outline Problem Formulation –Energy Function –Energy Minimization –Computing min-marginals Reparameterization Energy Minimization for Trees Loopy Belief Propagation
3
Energy Function VaVa VbVb VcVc VdVd Label l 0 Label l 1 Random Variables V = {V a, V b, ….} Labels L = {l 0, l 1, ….} Labelling f: {a, b, …. } {0,1, …}
4
Energy Function VaVa VbVb VcVc VdVd Q(f) = ∑ a a;f(a) Unary Potential 2 5 4 2 6 3 3 7 Label l 0 Label l 1 Easy to minimize Neighbourhood
5
Energy Function VaVa VbVb VcVc VdVd E : (a,b) E iff V a and V b are neighbours E = { (a,b), (b,c), (c,d) } 2 5 4 2 6 3 3 7 Label l 0 Label l 1
6
Energy Function VaVa VbVb VcVc VdVd +∑ (a,b) ab;f(a)f(b) Pairwise Potential 0 1 1 0 0 2 1 1 41 0 3 2 5 4 2 6 3 3 7 Label l 0 Label l 1 Q(f) = ∑ a a;f(a)
7
Energy Function VaVa VbVb VcVc VdVd 0 1 1 0 0 2 1 1 41 0 3 Parameter 2 5 4 2 6 3 3 7 Label l 0 Label l 1 +∑ (a,b) ab;f(a)f(b) Q(f; )= ∑ a a;f(a)
8
Outline Problem Formulation –Energy Function –Energy Minimization –Computing min-marginals Reparameterization Energy Minimization for Trees Loopy Belief Propagation
9
Energy Minimization VaVa VbVb VcVc VdVd 2 5 4 2 6 3 3 7 0 1 1 0 0 2 1 1 41 0 3 Q(f; ) = ∑ a a;f(a) + ∑ (a,b) ab;f(a)f(b) Label l 0 Label l 1
10
Energy Minimization VaVa VbVb VcVc VdVd 2 5 4 2 6 3 3 7 0 1 1 0 0 2 1 1 41 0 3 Q(f; ) = ∑ a a;f(a) + ∑ (a,b) ab;f(a)f(b) 2 + 1 + 2 + 1 + 3 + 1 + 3 = 13 Label l 0 Label l 1
11
Energy Minimization VaVa VbVb VcVc VdVd 2 5 4 2 6 3 3 7 0 1 1 0 0 2 1 1 41 0 3 Q(f; ) = ∑ a a;f(a) + ∑ (a,b) ab;f(a)f(b) Label l 0 Label l 1
12
Energy Minimization VaVa VbVb VcVc VdVd 2 5 4 2 6 3 3 7 0 1 1 0 0 2 1 1 41 0 3 Q(f; ) = ∑ a a;f(a) + ∑ (a,b) ab;f(a)f(b) 5 + 1 + 4 + 0 + 6 + 4 + 7 = 27 Label l 0 Label l 1
13
Energy Minimization VaVa VbVb VcVc VdVd 2 5 4 2 6 3 3 7 0 1 1 0 0 2 1 1 41 0 3 Q(f; ) = ∑ a a;f(a) + ∑ (a,b) ab;f(a)f(b) f* = arg min Q(f; ) q* = min Q(f; ) = Q(f*; ) Label l 0 Label l 1
14
Energy Minimization f(a)f(b)f(c)f(d) Q(f; ) 000018 000115 001027 001120 010022 010119 011027 011120 16 possible labellings f(a)f(b)f(c)f(d) Q(f; ) 100016 100113 101025 101118 1100 110115 111023 111116 f* = {1, 0, 0, 1} q* = 13
15
Outline Problem Formulation –Energy Function –Energy Minimization –Computing min-marginals Reparameterization Energy Minimization for Trees Loopy Belief Propagation
16
Min-Marginals VaVa VbVb VcVc VdVd 2 5 4 2 6 3 3 7 0 1 1 0 0 2 1 1 41 0 3 f* = arg min Q(f; ) such that f(a) = i Min-marginal q a;i Label l 0 Label l 1
17
Min-Marginals 16 possible labellings q a;0 = 15 f(a)f(b)f(c)f(d) Q(f; ) 000018 000115 001027 001120 010022 010119 011027 011120 f(a)f(b)f(c)f(d) Q(f; ) 100016 100113 101025 101118 1100 110115 111023 111116
18
Min-Marginals 16 possible labellings q a;1 = 13 f(a)f(b)f(c)f(d) Q(f; ) 100016 100113 101025 101118 1100 110115 111023 111116 f(a)f(b)f(c)f(d) Q(f; ) 000018 000115 001027 001120 010022 010119 011027 011120
19
Min-Marginals and MAP Minimum min-marginal of any variable = energy of MAP labelling min f Q(f; ) such that f(a) = i q a;i min i min i ( ) V a has to take one label min f Q(f; )
20
Summary Energy Minimization f* = arg min Q(f; ) Q(f; ) = ∑ a a;f(a) + ∑ (a,b) ab;f(a)f(b) Min-marginals q a;i = min Q(f; ) s.t. f(a) = i Energy Function
21
Outline Problem Formulation Reparameterization Energy Minimization for Trees Loopy Belief Propagation
22
Reparameterization VaVa VbVb 2 5 4 2 0 1 1 0 f(a)f(b) Q(f; ) 007 0110 105 116 2 + - 2 Add a constant to all a;i Subtract that constant from all b;k
23
Reparameterization f(a)f(b) Q(f; ) 007 + 2 - 2 0110 + 2 - 2 105 + 2 - 2 116 + 2 - 2 Add a constant to all a;i Subtract that constant from all b;k Q(f; ’) = Q(f; ) VaVa VbVb 2 5 4 2 0 0 2 + - 2 1 1
24
Reparameterization VaVa VbVb 2 5 4 2 0 1 1 0 f(a)f(b) Q(f; ) 007 0110 105 116 - 3 + 3 Add a constant to one b;k Subtract that constant from ab;ik for all ‘i’ - 3
25
Reparameterization VaVa VbVb 2 5 4 2 0 1 1 0 f(a)f(b) Q(f; ) 007 0110 - 3 + 3 105 116 - 3 + 3 - 3 + 3 - 3 Q(f; ’) = Q(f; ) Add a constant to one b;k Subtract that constant from ab;ik for all ‘i’
26
Reparameterization VaVa VbVb 2 5 4 2 31 0 1 2 VaVa VbVb 2 5 4 2 31 1 0 1 - 2 + 2 + 1 - 1 VaVa VbVb 2 5 4 2 31 2 1 0 - 4+ 4 - 4 ’ a;i = a;i ’ b;k = b;k ’ ab;ik = ab;ik + M ab;k - M ab;k + M ba;i - M ba;i Q(f; ’) = Q(f; )
27
Reparameterization Q(f; ’) = Q(f; ), for all f ’ is a reparameterization of , iff ’ ’ b;k = b;k ’ a;i = a;i ’ ab;ik = ab;ik + M ab;k - M ab;k + M ba;i - M ba;i Equivalently Kolmogorov, PAMI, 2006 VaVa VbVb 2 5 4 2 0 0 2 + - 2 11
28
Recap Energy Minimization f* = arg min Q(f; ) Q(f; ) = ∑ a a;f(a) + ∑ (a,b) ab;f(a)f(b) Min-marginals q a;i = min Q(f; ) s.t. f(a) = i Q(f; ’) = Q(f; ), for all f ’ Reparameterization
29
Outline Problem Formulation Reparameterization Energy Minimization for Trees Loopy Belief Propagation Pearl, 1988
30
Belief Propagation Belief Propagation is exact for chains Some problems are easy Exact MAP for trees Clever Reparameterization
31
Two Variables VaVa VbVb 2 5 2 1 0 VaVa VbVb 2 5 40 1 Choose the right constant ’ b;k = q b;k Add a constant to one b;k Subtract that constant from ab;ik for all ‘i’
32
VaVa VbVb 2 5 2 1 0 VaVa VbVb 2 5 40 1 Choose the right constant ’ b;k = q b;k a;0 + ab;00 = 5 + 0 a;1 + ab;10 = 2 + 1 min M ab;0 = Two Variables
33
VaVa VbVb 2 5 5 -2 -3 VaVa VbVb 2 5 40 1 Choose the right constant ’ b;k = q b;k Two Variables
34
VaVa VbVb 2 5 5 -2 -3 VaVa VbVb 2 5 40 1 Choose the right constant ’ b;k = q b;k f(a) = 1 ’ b;0 = q b;0 Two Variables Potentials along the red path add up to 0
35
VaVa VbVb 2 5 5 -2 -3 VaVa VbVb 2 5 40 1 Choose the right constant ’ b;k = q b;k a;0 + ab;01 = 5 + 1 a;1 + ab;11 = 2 + 0 min M ab;1 = Two Variables
36
VaVa VbVb 2 5 5 -2 -3 VaVa VbVb 2 5 6-2 Choose the right constant ’ b;k = q b;k f(a) = 1 ’ b;0 = q b;0 f(a) = 1 ’ b;1 = q b;1 Minimum of min-marginals = MAP estimate Two Variables
37
VaVa VbVb 2 5 5 -2 -3 VaVa VbVb 2 5 6-2 Choose the right constant ’ b;k = q b;k f(a) = 1 ’ b;0 = q b;0 f(a) = 1 ’ b;1 = q b;1 f*(b) = 0f*(a) = 1 Two Variables
38
VaVa VbVb 2 5 5 -2 -3 VaVa VbVb 2 5 6-2 Choose the right constant ’ b;k = q b;k f(a) = 1 ’ b;0 = q b;0 f(a) = 1 ’ b;1 = q b;1 We get all the min-marginals of V b Two Variables
39
Recap We only need to know two sets of equations General form of Reparameterization ’ a;i = a;i ’ ab;ik = ab;ik + M ab;k - M ab;k + M ba;i - M ba;i ’ b;k = b;k Reparameterization of (a,b) in Belief Propagation M ab;k = min i { a;i + ab;ik } M ba;i = 0
40
Three Variables VaVa VbVb 2 5 2 1 0 VcVc 460 1 0 1 3 2 3 Reparameterize the edge (a,b) as before l0l0 l1l1
41
VaVa VbVb 2 5 5 -3 VcVc 660 1 -2 3 Reparameterize the edge (a,b) as before f(a) = 1 -22 3 Three Variables l0l0 l1l1
42
VaVa VbVb 2 5 5 -3 VcVc 660 1 -2 3 Reparameterize the edge (a,b) as before f(a) = 1 Potentials along the red path add up to 0 -22 3 Three Variables l0l0 l1l1
43
VaVa VbVb 2 5 5 -3 VcVc 660 1 -2 3 Reparameterize the edge (b,c) as before f(a) = 1 Potentials along the red path add up to 0 -22 3 Three Variables l0l0 l1l1
44
VaVa VbVb 2 5 5 -3 VcVc 612-6 -5 -2 9 Reparameterize the edge (b,c) as before f(a) = 1 Potentials along the red path add up to 0 f(b) = 1 f(b) = 0 -2-4 -3 Three Variables l0l0 l1l1
45
VaVa VbVb 2 5 5 -3 VcVc 612-6 -5 -2 9 Reparameterize the edge (b,c) as before f(a) = 1 Potentials along the red path add up to 0 f(b) = 1 f(b) = 0 q c;0 q c;1 -2-4 -3 Three Variables l0l0 l1l1
46
VaVa VbVb 2 5 5 -3 VcVc 612-6 -5 -2 9 f(a) = 1 f(b) = 1 f(b) = 0 q c;0 q c;1 f*(c) = 0 f*(b) = 0f*(a) = 1 Generalizes to any length chain -2-4 -3 Three Variables l0l0 l1l1
47
VaVa VbVb 2 5 5 -3 VcVc 612-6 -5 -2 9 f(a) = 1 f(b) = 1 f(b) = 0 q c;0 q c;1 f*(c) = 0 f*(b) = 0f*(a) = 1 Dynamic Programming -2-4 -3 Three Variables l0l0 l1l1
48
Dynamic Programming 3 variables 2 variables + book-keeping n variables (n-1) variables + book-keeping Start from left, go to right Reparameterize current edge (a,b) M ab;k = min i { a;i + ab;ik } ’ ab;ik = ab;ik + M ab;k - M ab;k ’ b;k = b;k Repeat
49
Dynamic Programming Start from left, go to right Reparameterize current edge (a,b) M ab;k = min i { a;i + ab;ik } Repeat MessagesMessage Passing Why stop at dynamic programming? ’ ab;ik = ab;ik + M ab;k - M ab;k ’ b;k = b;k
50
VaVa VbVb 2 5 5 -3 VcVc 612-6 -5 -2 9 Reparameterize the edge (c,b) as before -2-4 -3 Three Variables l0l0 l1l1
51
VaVa VbVb 2 5 9 -3 VcVc 1112-11 -9 -2 9 Reparameterize the edge (c,b) as before -2-9 -7 ’ b;i = q b;i Three Variables l0l0 l1l1
52
VaVa VbVb 2 5 9 -3 VcVc 1112-11 -9 -2 9 Reparameterize the edge (b,a) as before -2-9 -7 Three Variables l0l0 l1l1
53
VaVa VbVb 9 11 9 -9 VcVc 1112-11 -9 9 Reparameterize the edge (b,a) as before -9-7-9 -7 ’ a;i = q a;i Three Variables l0l0 l1l1
54
VaVa VbVb 9 11 9 -9 VcVc 1112-11 -9 9 Forward Pass Backward Pass -9-7-9 -7 All min-marginals are computed Three Variables l0l0 l1l1
55
Belief Propagation on Chains Start from left, go to right Reparameterize current edge (a,b) M ab;k = min i { a;i + ab;ik } ’ ab;ik = ab;ik + M ab;k - M ab;k ’ b;k = b;k Repeat till the end of the chain Start from right, go to left Repeat till the end of the chain
56
Belief Propagation on Chains A way of computing reparam constants Generalizes to chains of any length Forward Pass - Start to End MAP estimate Min-marginals of final variable Backward Pass - End to start All other min-marginals
57
Computational Complexity Each constant takes O(|L|) Number of constants - O(|E||L|) O(|E||L| 2 ) Memory required ? O(|E||L|)
58
Belief Propagation on Trees VbVb VaVa Forward Pass: Leaf Root All min-marginals are computed Backward Pass: Root Leaf VcVc VdVd VeVe VgVg VhVh
59
Outline Problem Formulation Reparameterization Energy Minimization for Trees Loopy Belief Propagation Pearl, 1988; Murphy et al., 1999
60
Belief Propagation on Cycles VaVa VbVb VdVd VcVc Where do we start? Arbitrarily a;0 a;1 b;0 b;1 d;0 d;1 c;0 c;1 Reparameterize (a,b)
61
Belief Propagation on Cycles VaVa VbVb VdVd VcVc a;0 a;1 ’ b;0 ’ b;1 d;0 d;1 c;0 c;1 Potentials along the red path add up to 0
62
Belief Propagation on Cycles VaVa VbVb VdVd VcVc a;0 a;1 ’ b;0 ’ b;1 d;0 d;1 ’ c;0 ’ c;1 Potentials along the red path add up to 0
63
Belief Propagation on Cycles VaVa VbVb VdVd VcVc a;0 a;1 ’ b;0 ’ b;1 ’ d;0 ’ d;1 ’ c;0 ’ c;1 Potentials along the red path add up to 0
64
Belief Propagation on Cycles VaVa VbVb VdVd VcVc ’ a;0 ’ a;1 ’ b;0 ’ b;1 ’ d;0 ’ d;1 ’ c;0 ’ c;1 Potentials along the red path add up to 0
65
Belief Propagation on Cycles VaVa VbVb VdVd VcVc ’ a;0 ’ a;1 ’ b;0 ’ b;1 ’ d;0 ’ d;1 ’ c;0 ’ c;1 Potentials along the red path add up to 0 - a;0 - a;1
66
Belief Propagation on Cycles VaVa VbVb VdVd VcVc a;0 a;1 b;0 b;1 d;0 d;1 c;0 c;1 Any suggestions?Fix V a to label l 0
67
Belief Propagation on Cycles VaVa VbVb VdVd VcVc Any suggestions?Fix V a to label l 0 a;0 b;0 b;1 d;0 d;1 c;0 c;1 Equivalent to a tree-structured problem
68
Belief Propagation on Cycles VaVa VbVb VdVd VcVc a;1 b;0 b;1 d;0 d;1 c;0 c;1 Any suggestions?Fix V a to label l 1 Equivalent to a tree-structured problem
69
Belief Propagation on Cycles Choose the minimum energy solution VaVa VbVb VdVd VcVc a;0 a;1 b;0 b;1 d;0 d;1 c;0 c;1 This approach quickly becomes infeasible
70
Loopy Belief Propagation V1V1 V2V2 V3V3 V4V4 V5V5 V6V6 V7V7 V8V8 V9V9 Keep reparameterizing edges in some order Hope for convergence and a good solution
71
Belief Propagation Generalizes to any arbitrary random field Complexity per iteration ? O(|E||L| 2 ) Memory required ? O(|E||L|)
72
Graph Cuts as Reparameterization?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.