+ All Categories
Home > Documents > 12-DP Tutorial Chew - EECS€¦ · Chew:&Dynamic&Programming&Tutorial& 3/26/12...

12-DP Tutorial Chew - EECS€¦ · Chew:&Dynamic&Programming&Tutorial& 3/26/12...

Date post: 27-Apr-2020
Category:
Upload: others
View: 15 times
Download: 0 times
Share this document with a friend
17
Chew: Dynamic Programming Tutorial 3/26/12 QMUL: ELE021/ELED021/ELEM021 1 Dynamic Programming Tutorial Elaine Chew QMUL: ELE021/ELED021/ELEM021 26 March 2012 Sources Hillier, F. S. & G. J. Lieberman. IntroducMon to OperaMons Research. Chapter 11: Dynamic Programming, 7 th ,8 th ,9 th ediMons, McGrawHill. Dixon, S. & Widmer, G. (2005). MATCH: A Music Alignment Tool Chest. In Proceedings of the 6 th Intl Conf on Music InformaMon Retrieval, London, UK, 492497. Yang, A., E. Chew & A. Volk (2005). A Dynamic Programming Approach to AdapMve Tatum Assignment for Rhythm TranscripMon. In Proceedings of the 1 st IEEE Intl Wkshop on MulMmedia InformaMon Processing and, Irvine, CA, 577584.
Transcript

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   1  

Dynamic  Programming  Tutorial  

Elaine  Chew  

QMUL:  ELE021/ELED021/ELEM021  

26  March  2012  

Sources  

•  Hillier,  F.  S.  &  G.  J.  Lieberman.  IntroducMon  to  OperaMons  Research.    Chapter  11:  Dynamic  Programming,  7th,  8th,  9th  ediMons,  McGraw-­‐Hill.  

•  Dixon,  S.  &  Widmer,  G.  (2005).  MATCH:  A  Music  Alignment  Tool  Chest.  In  Proceedings  of  the  6th  Intl  Conf  on  Music  InformaMon  Retrieval,  London,  UK,  492-­‐497.  

•  Yang,  A.,  E.  Chew  &  A.  Volk  (2005).  A  Dynamic  Programming  Approach  to  AdapMve  Tatum  Assignment  for  Rhythm  TranscripMon.  In  Proceedings  of  the  1st  IEEE  Intl  Wkshop  on  MulMmedia  InformaMon  Processing  and,  Irvine,  CA,  577-­‐584.  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   2  

Sources  

•  Hillier,  F.  S.  &  G.  J.  Lieberman.  IntroducMon  to  OperaMons  Research.    Chapter  11:  Dynamic  Programming,  7th,  8th,  9th  ediMons,  McGraw-­‐Hill.  

•  Dixon,  S.  &  Widmer,  G.  (2005).  MATCH:  A  Music  Alignment  Tool  Chest.  In  Proceedings  of  the  6th  Intl  Conf  on  Music  InformaMon  Retrieval,  London,  UK,  492-­‐497.  

•  Yang,  A.,  E.  Chew  &  A.  Volk  (2005).  A  Dynamic  Programming  Approach  to  AdapMve  Tatum  Assignment  for  Rhythm  TranscripMon.  In  Proceedings  of  the  1st  IEEE  Intl  Wkshop  on  MulMmedia  InformaMon  Processing  and,  Irvine,  CA,  577-­‐584.  

Shortest  Path  Problem  

•  V  =  set  of  verMces  (or  nodes)  •  E  =  set  of  edges  (or  arcs),  including  s  (source)  and  t  (sink)  

•  C  =  [cij]  =  set  of  arc  costs  •  X  =  indicator  variable  for  whether  arc  ij  is  used  •  Linear  Programming  Problem  FormulaMon:  

           Min    Σij  cijxij              s.t.    Σi  xij  =  1                  Σj  xij  =  1                  0  ≤  xij  ≤  1    

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   3  

Hogwarts  (Shortest  Path)  Example  

•  Determine  which  route  from  entrance  to  exit  has  the  shortest  distance  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

Gringoi’s  Wizarding  

Bank  

Entrance  to  Wizarding  World  

Quality  Quidditch  Supplies  Ollivander’s  

Exit  to  Charing  Cross  

Road  

The  Leaky  Cauldron  

Magical  Menagerie  

Algorithm  

•  At  iteraMon  i  – ObjecMve:  find  the  i-­‐th  nearest  node  to  the  origin  –  Input:  i-­‐1  nearest  node  to  the  origin,  shortest  path  and  distance  

– Candidates  for  i-­‐th  nearest  node:  nearest  unsolved  node  to  one  solved  

– CalculaMon  for  i-­‐th  nearest  node:  for  each  new  candidate,  add  new  edge  to  previously  found  shortest  path  to  the  i-­‐1-­‐th  nearest  node.    Among  the  new  candidates,  the  node  with  shortest  distance  becomes  the  i-­‐th  nearest  node.    

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   4  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

Hogwarts  (Shortest  Path)  Example  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

0  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   5  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

1   R   Q   5   Q   5   Q  

Hogwarts  (Shortest  Path)  Example  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

5  

0  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   6  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

1   R   Q   5   Q   5   R  

2   Q  R  

C  C  

6  7  

C   6   Q  

Hogwarts  (Shortest  Path)  Example  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

5  

0  

6  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   7  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

1   R   Q   5   Q   5   R  

2   Q  R  

C  C  

6  7  

C   6   Q  

3   Q  C  

O  O  

9  9  

O   9   Q  C  

Hogwarts  (Shortest  Path)  Example  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

5  

0  

6  

9  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   8  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

1   R   Q   5   Q   5   R  

2   Q  R  

C  C  

6  7  

C   6   Q  

3   Q  C  

O  O  

9  9  

O   9   Q  C  

4   Q  C  O  

G  M  M  

12  10  10  

M   10   C  O  

Hogwarts  (Shortest  Path)  Example  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

5  

0  

6  

9  

10  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   9  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

1   R   Q   5   Q   5   R  

2   Q  R  

C  C  

6  7  

C   6   Q  

3   Q  C  

O  O  

9  9  

O   9   Q  C  

4   Q  C  O  

G  M  M  

12  10  10  

M   10   C  O  

5   Q  O  M  

G  G  E  

12  11  14  

G   11   O  

Hogwarts  (Shortest  Path)  Example  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

5  

0  

6  

9  

10  

11  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   10  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

1   R   Q   5   Q   5   R  

2   Q  R  

C  C  

6  7  

C   6   Q  

3   Q  C  

O  O  

9  9  

O   9   Q  C  

4   Q  C  O  

G  M  M  

12  10  10  

M   10   C  O  

5   Q  O  M  

G  G  E  

12  11  14  

G   11   O  

ImplementaMon  Itera&on,  i   Solved  nodes  

connected  to  unsolved  

Closest  connected  unsolved  node  

Total  distance  involved  

i-­‐th  nearest  node  

Minimum  distance  

Last  connec&on  

5   Q  O  M  

G  G  E  

12  11  14  

G   11   O  

6   O  M  G  

E  E  E  

14  14  13  

E   13   G  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   11  

Hogwarts  (Shortest  Path)  Example  

7  

4  

2  2  

5  

1  4  

4  

5  

1   7  

G  

O E   Q  

R  

M   C  

3  

5  

0  

6  

9  

10  

11  

13  

Sources  

•  Hillier,  F.  S.  &  G.  J.  Lieberman.  IntroducMon  to  OperaMons  Research.    Chapter  11:  Dynamic  Programming,  7th,  8th,  9th  ediMons,  McGraw-­‐Hill.  

•  Dixon,  S.  &  Widmer,  G.  (2005).  MATCH:  A  Music  Alignment  Tool  Chest.  In  Proceedings  of  the  6th  Intl  Conf  on  Music  InformaMon  Retrieval,  London,  UK,  492-­‐497.  

•  Yang,  A.,  E.  Chew  &  A.  Volk  (2005).  A  Dynamic  Programming  Approach  to  AdapMve  Tatum  Assignment  for  Rhythm  TranscripMon.  In  Proceedings  of  the  1st  IEEE  Intl  Wkshop  on  MulMmedia  InformaMon  Processing  and,  Irvine,  CA,  577-­‐584.  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   12  

Dynamic  Time  Warping  

Euclidean  Distance  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   13  

(i,j)  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   14  

Sources  

•  Hillier,  F.  S.  &  G.  J.  Lieberman.  IntroducMon  to  OperaMons  Research.    Chapter  11:  Dynamic  Programming,  7th,  8th,  9th  ediMons,  McGraw-­‐Hill.  

•  Dixon,  S.  &  Widmer,  G.  (2005).  MATCH:  A  Music  Alignment  Tool  Chest.  In  Proceedings  of  the  6th  Intl  Conf  on  Music  InformaMon  Retrieval,  London,  UK,  492-­‐497.  

•  Yang,  A.,  E.  Chew  &  A.  Volk  (2005).  A  Dynamic  Programming  Approach  to  AdapMve  Tatum  Assignment  for  Rhythm  TranscripMon.  In  Proceedings  of  the  1st  IEEE  Intl  Wkshop  on  MulMmedia  InformaMon  Processing  and,  Irvine,  CA,  577-­‐584.  

Tatum  SegmentaMon  

•  Tatum  =  smallest  perceptual  Mme  unit  in  music  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   15  

Example  Results  

40

60

80

100

120

140

0 100 200 300 400 Beats

Tatum

Coarse Manual Segmentation bepthq3 son08_3

SegmentaMon  

•  Example  of  tatum  selecMon  •  Input:  

– Note  onset  Mmes,  O(1,n)  =  {O1,  O2,…,  On}    

•  Output:  – SegmentaMon  points,  S  =  {S1,  S2,…,Sm}  – OpMmal  tatum  in  each  segment  

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   16  

Remainder  Squared  Error  

o(1)  …                                        o(j)  

p  

1      …                                            j              j+1  

p  

ERR(.)  

 The  error  incurred  by  a  tatum  assignment,  p,  for  onsets  O(i+  1,k)  is  given  by  the  remainder  squared  error  (RSE)  funcMon:  

 where  oj  (=  Oj+1  –  Oj)  is  the  inter  onset  interval  (IOI)  between  onsets  j  and  j+1.    

e(p,i + 1,k) =ojp−ojp

+12

⎣ ⎢

⎦ ⎥

⎝ ⎜

⎠ ⎟

j =1

k − i −1

∑2

,

ERR(O(i + 1,k)) =pmin e(p,i + 1,k).

Chew:  Dynamic  Programming  Tutorial   3/26/12  

QMUL:  ELE021/ELED021/ELEM021   17  

OpMmal  SegmentaMon  

•  Define  OPT(k)  to  be  the  best  segmentaMon  (cost)  for  a  given  set  of  onsets  O(1,k):  

 where  ERR(.)  returns  the  error  incurred  by  the  best  tatum  assignment  for  the  set  of  onsets      O(i+1,k).  €

OPT(k) =1≤ i ≤kmin {OPT(i)+ ERR(O(i + 1,k))},

k  i      i+1                                                    …  1                                                              …  


Recommended