{"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/uncertainty-dtw-for-time-series-and-sequences","title":"Uncertainty-DTW for Time Series and Sequences","arxiv_id":"2211.00005","date":"2022-10-30","proceeding":null,"authors":["Lei Wang","Piotr Koniusz"],"abstract":"Dynamic Time Warping (DTW) is used for matching pairs of sequences and celebrated in applications such as forecasting the evolution of time series, clustering time series or even matching sequence pairs in few-shot action recognition. The transportation plan of DTW contains a set of paths; each path matches frames between two sequences under a varying degree of time warping, to account for varying temporal intra-class dynamics of actions. However, as DTW is the smallest distance among all paths, it may be affected by the feature uncertainty which varies across time steps/frames. Thus, in this paper, we propose to model the so-called aleatoric uncertainty of a differentiable (soft) version of DTW. To this end, we model the heteroscedastic aleatoric uncertainty of each path by the product of likelihoods from Normal distributions, each capturing variance of pair of frames. (The path distance is the sum of base distances between features of pairs of frames of the path.) The Maximum Likelihood Estimation (MLE) applied to a path yields two terms: (i) a sum of Euclidean distances weighted by the variance inverse, and (ii) a sum of log-variance regularization terms. Thus, our uncertainty-DTW is the smallest weighted path distance among all paths, and the regularization term (penalty for the high uncertainty) is the aggregate of log-variances along the path. The distance and the regularization term can be used in various objectives. We showcase forecasting the evolution of time series, estimating the Fr\\'echet mean of time series, and supervised/unsupervised few-shot action recognition of the articulated human 3D body joints.","url_abs":"https://arxiv.org/abs/2211.00005v1","url_pdf":"https://arxiv.org/pdf/2211.00005v1.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":"uncertainty-dtw-for-time-series-and-sequences","repo_url":"https://github.com/leiwangr/udtw","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[{"task_slug":"action-recognition-in-videos","task_name":"Action Recognition"},{"task_slug":"dynamic-time-warping","task_name":"Dynamic Time Warping"},{"task_slug":"few-shot-action-recognition","task_name":"Few Shot Action Recognition"},{"task_slug":"few-shot-action-recognition","task_name":"Few-Shot action recognition"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"},{"task_slug":"time-series-clustering","task_name":"Time Series Clustering"}],"methods":[{"method_slug":"base","method_name":"BASE"},{"method_slug":"dtw","method_name":"DTW"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2211.00005","atlas_url":"https://app.syntology.ai/?focus=2211.00005","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2211.00005"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/leiwangr/udtw","reach":null}],"summary":{"ran":2,"ran_fixture":2,"unverified":3},"by_repo_kind":{"official":{"samples":7,"ran":4,"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":7,"samples":[{"code_sha256_prefix":"3cd72643274fe371","entry":"_SoftDTW","repo":"leiwangr/udtw","repo_kind":"official","path":"uDTW.py","file_url":"https://github.com/leiwangr/udtw/blob/HEAD/uDTW.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"3cd72643274fe371"}},{"code_sha256_prefix":"939fea17c8ba2fcd","entry":"_SoftDTWCUDA","repo":"leiwangr/udtw","repo_kind":"official","path":"uDTW.py","file_url":"https://github.com/leiwangr/udtw/blob/HEAD/uDTW.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"939fea17c8ba2fcd"}},{"code_sha256_prefix":"7004997843b54cce","entry":"compute_softdtw","repo":"leiwangr/udtw","repo_kind":"official","path":"uDTW.py","file_url":"https://github.com/leiwangr/udtw/blob/HEAD/uDTW.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7004997843b54cce"}},{"code_sha256_prefix":"c059b14c600bf564","entry":"compute_softdtw_backward","repo":"leiwangr/udtw","repo_kind":"official","path":"uDTW.py","file_url":"https://github.com/leiwangr/udtw/blob/HEAD/uDTW.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c059b14c600bf564"}},{"code_sha256_prefix":"e23326afe6cbf283","entry":"compute_softdtw_backward_cuda","repo":"leiwangr/udtw","repo_kind":"official","path":"uDTW.py","file_url":"https://github.com/leiwangr/udtw/blob/HEAD/uDTW.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e23326afe6cbf283"}},{"code_sha256_prefix":"7aecca5640ddf1da","entry":"compute_softdtw_cuda","repo":"leiwangr/udtw","repo_kind":"official","path":"uDTW.py","file_url":"https://github.com/leiwangr/udtw/blob/HEAD/uDTW.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7aecca5640ddf1da"}},{"code_sha256_prefix":"8d82d78cfff3ba9c","entry":"uDTW","repo":"leiwangr/udtw","repo_kind":"official","path":"uDTW.py","file_url":"https://github.com/leiwangr/udtw/blob/HEAD/uDTW.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"8d82d78cfff3ba9c"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}