{"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/shape-and-time-distortion-loss-for-training","title":"Shape and Time Distortion Loss for Training Deep Time Series Forecasting Models","arxiv_id":"1909.09020","date":"2019-09-19","proceeding":"NeurIPS 2019 12","authors":["Vincent Le Guen","Nicolas Thome"],"abstract":"This paper addresses the problem of time series forecasting for non-stationary signals and multiple future steps prediction. To handle this challenging task, we introduce DILATE (DIstortion Loss including shApe and TimE), a new objective function for training deep neural networks. DILATE aims at accurately predicting sudden changes, and explicitly incorporates two terms supporting precise shape and temporal change detection. We introduce a differentiable loss function suitable for training deep neural nets, and provide a custom back-prop implementation for speeding up optimization. We also introduce a variant of DILATE, which provides a smooth generalization of temporally-constrained Dynamic Time Warping (DTW). Experiments carried out on various non-stationary datasets reveal the very good behaviour of DILATE compared to models trained with the standard Mean Squared Error (MSE) loss function, and also to DTW and variants. DILATE is also agnostic to the choice of the model, and we highlight its benefit for training fully connected networks as well as specialized recurrent architectures, showing its capacity to improve over state-of-the-art trajectory forecasting approaches.","url_abs":"https://arxiv.org/abs/1909.09020v4","url_pdf":"https://arxiv.org/pdf/1909.09020v4.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":"shape-and-time-distortion-loss-for-training","repo_url":"https://github.com/vincent-leguen/DILATE","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null},{"paper_slug":"shape-and-time-distortion-loss-for-training","repo_url":"https://github.com/vincent-leguen/STDL","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"NOASSERTION"}},{"paper_slug":"shape-and-time-distortion-loss-for-training","repo_url":"https://github.com/marcdemers/batch-DILATE","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"change-detection","task_name":"Change Detection"},{"task_slug":"dynamic-time-warping","task_name":"Dynamic Time Warping"},{"task_slug":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series","task_name":"Time Series Analysis"},{"task_slug":"time-series-forecasting","task_name":"Time Series Forecasting"},{"task_slug":"trajectory-forecasting","task_name":"Trajectory Forecasting"}],"methods":[{"method_slug":"dtw","method_name":"DTW"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=1909.09020","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"1909.09020"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/marcdemers/batch-DILATE","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vincent-leguen/DILATE","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/vincent-leguen/STDL","reach":{"status":"ok","spdx":"NOASSERTION"}}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":1,"ran":0,"repositories":1},"listed":{"samples":2,"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":1,"samples":[{"code_sha256_prefix":"8ba333ffeea1204d","entry":"dilate_loss","repo":"vincent-leguen/DILATE","repo_kind":"official","path":"loss/dilate_loss.py","file_url":"https://github.com/vincent-leguen/DILATE/blob/HEAD/loss/dilate_loss.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NOASSERTION","inline_ok":false,"mcp_get_code":{"code_sha256":"8ba333ffeea1204d"}},{"code_sha256_prefix":"378682cc84a2f89e","entry":"pairwise_distances","repo":"marcdemers/batch-DILATE","repo_kind":"listed","path":"batchdilate/soft_dtw.py","file_url":"https://github.com/marcdemers/batch-DILATE/blob/HEAD/batchdilate/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":"378682cc84a2f89e"}},{"code_sha256_prefix":"b300cfe35c0a9a18","entry":"pairwise_distances_with_channels_and_batches","repo":"marcdemers/batch-DILATE","repo_kind":"listed","path":"batchdilate/soft_dtw.py","file_url":"https://github.com/marcdemers/batch-DILATE/blob/HEAD/batchdilate/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":"b300cfe35c0a9a18"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}