Download presentation
Presentation is loading. Please wait.
Published byBryce Brown Modified over 9 years ago
1
Dynamic Programming Tutorial Elaine Chew QMUL: ELE021/ELED021/ELEM021 26 March 2012
2
Sources Hillier, F. S. & G. J. Lieberman. Introduction to Operations Research. Chapter 11: Dynamic Programming, 7 th, 8 th, 9 th editions, McGraw-Hill. Dixon, S. & Widmer, G. (2005). MATCH: A Music Alignment Tool Chest. In Proceedings of the 6 th Intl Conf on Music Information Retrieval, London, UK, 492- 497. Yang, A., E. Chew & A. Volk (2005). A Dynamic Programming Approach to Adaptive Tatum Assignment for Rhythm Transcription. In Proceedings of the 1 st IEEE Intl Wkshop on Multimedia Information Processing and, Irvine, CA, 577-584.
3
Sources Hillier, F. S. & G. J. Lieberman. Introduction to Operations Research. Chapter 11: Dynamic Programming, 7 th, 8 th, 9 th editions, McGraw-Hill. Dixon, S. & Widmer, G. (2005). MATCH: A Music Alignment Tool Chest. In Proceedings of the 6 th Intl Conf on Music Information Retrieval, London, UK, 492- 497. Yang, A., E. Chew & A. Volk (2005). A Dynamic Programming Approach to Adaptive Tatum Assignment for Rhythm Transcription. In Proceedings of the 1 st IEEE Intl Wkshop on Multimedia Information Processing and, Irvine, CA, 577-584.
4
Shortest Path Problem V = set of vertices (or nodes) E = set of edges (or arcs), including s (source) and t (sink) C = [c ij ] = set of arc costs X = indicator variable for whether arc ij is used Linear Programming Problem Formulation: Min Σ ij c ij x ij s.t.Σ i x ij = 1 Σ j x ij = 1 0 ≤ x ij ≤ 1
5
Hogwarts (Shortest Path) Example Determine which route from entrance to exit has the shortest distance 7 4 22 5 14 4 5 17 G O EQ R MC 3 Gringott’s Wizarding Bank Entrance to Wizarding World Quality Quidditch Supplies Ollivander’s Exit to Charing Cross Road The Leaky Cauldron Magical Menagerie
6
Algorithm At iteration i – Objective: 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 – Calculation 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.
7
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection
8
Hogwarts (Shortest Path) Example 7 4 22 5 14 4 5 17 G O EQ R MC 3 0
9
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection 1RQ5Q5Q
10
Hogwarts (Shortest Path) Example 7 4 22 5 14 4 5 17 G O EQ R MC 3 5 0
11
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection 1RQ5Q5R 2QRQR CCCC 6767 C6Q
12
Hogwarts (Shortest Path) Example 7 4 22 5 14 4 5 17 G O EQ R MC 3 5 0 6
13
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection 1RQ5Q5R 2QRQR CCCC 6767 C6Q 3QCQC OOOO 9999 O9QCQC
14
Hogwarts (Shortest Path) Example 7 4 22 5 14 4 5 17 G O EQ R MC 3 5 0 6 9
15
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection 1RQ5Q5R 2QRQR CCCC 6767 C6Q 3QCQC OOOO 9999 O9QCQC 4QCOQCO GMMGMM 12 10 M COCO
16
Hogwarts (Shortest Path) Example 7 4 22 5 14 4 5 17 G O EQ R MC 3 5 0 6 9 10
17
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection 1RQ5Q5R 2QRQR CCCC 6767 C6Q 3QCQC OOOO 9999 O9QCQC 4QCOQCO GMMGMM 12 10 M COCO 5QOMQOM GGEGGE 12 11 14 G11O
18
Hogwarts (Shortest Path) Example 7 4 22 5 14 4 5 17 G O EQ R MC 3 5 0 6 9 10 11
19
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection 1RQ5Q5R 2QRQR CCCC 6767 C6Q 3QCQC OOOO 9999 O9QCQC 4QCOQCO GMMGMM 12 10 M COCO 5QOMQOM GGEGGE 12 11 14 G11O
20
Implementation Iteration, iSolved nodes connected to unsolved Closest connected unsolved node Total distance involved i-th nearest node Minimum distance Last connection 5QOMQOM GGEGGE 12 11 14 G11O 6OMGOMG EEEEEE 14 13 E G
21
Hogwarts (Shortest Path) Example 7 4 22 5 14 4 5 17 G O EQ R MC 3 5 0 6 9 10 11 13
22
Sources Hillier, F. S. & G. J. Lieberman. Introduction to Operations Research. Chapter 11: Dynamic Programming, 7 th, 8 th, 9 th editions, McGraw-Hill. Dixon, S. & Widmer, G. (2005). MATCH: A Music Alignment Tool Chest. In Proceedings of the 6 th Intl Conf on Music Information Retrieval, London, UK, 492- 497. Yang, A., E. Chew & A. Volk (2005). A Dynamic Programming Approach to Adaptive Tatum Assignment for Rhythm Transcription. In Proceedings of the 1 st IEEE Intl Wkshop on Multimedia Information Processing and, Irvine, CA, 577-584.
23
Dynamic Time Warping
24
Euclidean Distance
25
(i,j )
27
Sources Hillier, F. S. & G. J. Lieberman. Introduction to Operations Research. Chapter 11: Dynamic Programming, 7 th, 8 th, 9 th editions, McGraw-Hill. Dixon, S. & Widmer, G. (2005). MATCH: A Music Alignment Tool Chest. In Proceedings of the 6 th Intl Conf on Music Information Retrieval, London, UK, 492- 497. Yang, A., E. Chew & A. Volk (2005). A Dynamic Programming Approach to Adaptive Tatum Assignment for Rhythm Transcription. In Proceedings of the 1 st IEEE Intl Wkshop on Multimedia Information Processing and, Irvine, CA, 577-584.
28
Tatum Segmentation Tatum = smallest perceptual time unit in music
29
Example Results
30
Segmentation Example of tatum selection Input: – Note onset times, O(1,n) = {O 1, O 2,…, O n } Output: – Segmentation points, S = {S 1, S 2,…,S m } – Optimal tatum in each segment
31
Remainder Squared Error o(1) … o(j) p 1 … j j+1 p
32
ERR(.) The error incurred by a tatum assignment, p, for onsets O(i+ 1,k) is given by the remainder squared error (RSE) function: where o j (= O j+1 – O j ) is the inter onset interval (IOI) between onsets j and j+1.
33
Optimal Segmentation Define OPT(k) to be the best segmentation (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). k i i+1 … 1 …
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.