{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/deep-declarative-dynamic-time-warping-for-end","title":"Deep Declarative Dynamic Time Warping for End-to-End Learning of Alignment Paths","arxiv_id":"2303.10778","date":"2023-03-19","proceeding":null,"authors":["Ming Xu","Sourav Garg","Michael Milford","Stephen Gould"],"abstract":"This paper addresses learning end-to-end models for time series data that include a temporal alignment step via dynamic time warping (DTW). Existing approaches to differentiable DTW either differentiate through a fixed warping path or apply a differentiable relaxation to the min operator found in the recursive steps used to solve the DTW problem. We instead propose a DTW layer based around bi-level optimisation and deep declarative networks, which we name DecDTW. By formulating DTW as a continuous, inequality constrained optimisation problem, we can compute gradients for the solution of the optimal alignment (with respect to the underlying time series) using implicit differentiation. An interesting byproduct of this formulation is that DecDTW outputs the optimal warping path between two time series as opposed to a soft approximation, recoverable from Soft-DTW. We show that this property is particularly useful for applications where downstream loss functions are defined on the optimal alignment path itself. This naturally occurs, for instance, when learning to improve the accuracy of predicted alignments against ground truth alignments. We evaluate DecDTW on two such applications, namely the audio-to-score alignment task in music information retrieval and the visual place recognition task in robotics, demonstrating state-of-the-art results in both.","url_abs":"https://arxiv.org/abs/2303.10778v1","url_pdf":"https://arxiv.org/pdf/2303.10778v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"deep-declarative-dynamic-time-warping-for-end","repo_url":"https://github.com/mingu6/declarativedtw","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"dynamic-time-warping","task_name":"Dynamic Time Warping"},{"task_slug":"information-retrieval","task_name":"Information Retrieval"},{"task_slug":"music-information-retrieval","task_name":"Music Information Retrieval"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"visual-place-recognition","task_name":"Visual Place Recognition"}],"methods":[{"method_slug":"dtw","method_name":"DTW"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2303.10778","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2303.10778"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/mingu6/declarativedtw","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":18},"by_repo_kind":{"official":{"samples":18,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"cb46bd04c7ac2de9","entry":"batched_tridiagonal_solve","repo":"mingu6/declarativedtw","repo_kind":"official","path":"decdtw/backward/utils.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/decdtw/backward/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cb46bd04c7ac2de9"}},{"code_sha256_prefix":"6339ddb0b6dc5ae5","entry":"build_Omega","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/dilate_loss.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/dilate_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6339ddb0b6dc5ae5"}},{"code_sha256_prefix":"e5f415e497a655b9","entry":"build_Omega","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/vpr/dilate_loss.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/vpr/dilate_loss.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e5f415e497a655b9"}},{"code_sha256_prefix":"63dedce93135c081","entry":"compute_softdtw","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/comparisons.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/comparisons.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"63dedce93135c081"}},{"code_sha256_prefix":"de6839d7b9993193","entry":"compute_softdtw","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/soft_dtw.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/soft_dtw.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"de6839d7b9993193"}},{"code_sha256_prefix":"b7ef42ad24e33b6d","entry":"compute_softdtw_backward","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/comparisons.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/comparisons.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b7ef42ad24e33b6d"}},{"code_sha256_prefix":"cfd049ad7b29f58c","entry":"compute_softdtw_backward","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/soft_dtw.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/soft_dtw.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cfd049ad7b29f58c"}},{"code_sha256_prefix":"b6981241440d2103","entry":"constraints_grad_hGlbConstr","repo":"mingu6/declarativedtw","repo_kind":"official","path":"decdtw/backward/constraints.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/decdtw/backward/constraints.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b6981241440d2103"}},{"code_sha256_prefix":"4c25b91eb64a6b88","entry":"constraints_grad_hY","repo":"mingu6/declarativedtw","repo_kind":"official","path":"decdtw/backward/constraints.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/decdtw/backward/constraints.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4c25b91eb64a6b88"}},{"code_sha256_prefix":"3c2564bf11c3f00c","entry":"dtw_objective","repo":"mingu6/declarativedtw","repo_kind":"official","path":"decdtw/utils.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/decdtw/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3c2564bf11c3f00c"}},{"code_sha256_prefix":"c011f7bc2d35843a","entry":"map_score","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/datasets.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/datasets.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c011f7bc2d35843a"}},{"code_sha256_prefix":"ac24165407fc997f","entry":"my_max","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/path_soft_dtw.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/path_soft_dtw.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ac24165407fc997f"}},{"code_sha256_prefix":"2762a706aba6e342","entry":"my_max_hessian_product","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/path_soft_dtw.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/path_soft_dtw.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2762a706aba6e342"}},{"code_sha256_prefix":"f0e6c9e94033d95b","entry":"my_min","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/path_soft_dtw.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/path_soft_dtw.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f0e6c9e94033d95b"}},{"code_sha256_prefix":"f18232ab89e49092","entry":"pairwise_distances","repo":"mingu6/declarativedtw","repo_kind":"official","path":"experiments/audio_score/soft_dtw.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/experiments/audio_score/soft_dtw.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f18232ab89e49092"}},{"code_sha256_prefix":"e0a7117c444fa4cb","entry":"regularisation_loss","repo":"mingu6/declarativedtw","repo_kind":"official","path":"decdtw/utils.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/decdtw/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e0a7117c444fa4cb"}},{"code_sha256_prefix":"d4bac3ed82144852","entry":"signal_error","repo":"mingu6/declarativedtw","repo_kind":"official","path":"decdtw/utils.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/decdtw/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d4bac3ed82144852"}},{"code_sha256_prefix":"af12f07b5f7014ec","entry":"warp_fn_glb_bounds","repo":"mingu6/declarativedtw","repo_kind":"official","path":"decdtw/gdtw_solver/dp_graph.py","file_url":"https://github.com/mingu6/declarativedtw/blob/HEAD/decdtw/gdtw_solver/dp_graph.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"af12f07b5f7014ec"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}