Papers › Soft-DTW: a Differentiable Loss Function for Time-Series

Soft-DTW: a Differentiable Loss Function for Time-Series

5 Mar 2017ICML 2017 8arXiv:1703.01541archive 2025-07-28

Marco Cuturi, Mathieu Blondel

We propose in this paper a differentiable learning loss between time series, building upon the celebrated dynamic time warping (DTW) discrepancy. Unlike the Euclidean distance, DTW can compare time series of variable size and is robust to shifts or dilatations across the time dimension. To compute DTW, one typically solves a minimal-cost alignment problem between two time series using dynamic programming. Our work takes advantage of a smoothed formulation of DTW, called soft-DTW, that computes the soft-minimum of all alignment costs. We show in this paper that soft-DTW is a differentiable loss function, and that both its value and gradient can be computed with quadratic time/space complexity (DTW has quadratic time but linear space complexity). We show that this regularization is particularly well suited to average and cluster time series under the DTW geometry, a task for which our proposal significantly outperforms existing baselines. Next, we propose to tune the parameters of a machine that outputs time series by minimizing its fit with ground-truth labels in a soft-DTW sense.

PaperPDFConference PDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="1703.01541")

Code

Syntology Ran 1 of 11 code samples harvested from 5 repositories linked to this paper; 10 have no recorded run. Of those that ran: 1 ran · fixture could not drive it.

By repository: official repository: 2 samples from 1 repository, 0 ran; community (archive-listed): 9 samples from 4 repositories, 1 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

mblondel/soft-dtw officialmentioned in papermentioned on GitHubBSD-2-Clause report
Maghoumi/DeepNAG mentioned on GitHubpytorchMIT report
PeteWe/ts_similarity_tensorflow mentioned on GitHubtf report
baggepinnen/DynamicAxisWarping.jl mentioned on GitHubNOASSERTION report
jihyeonseong/SoM-TP mentioned on GitHubpytorch report
keonlee9420/Soft-DTW-Loss mentioned on GitHubpytorch report
khdlr/softdtw_jax mentioned on GitHubjaxMIT report
lyprince/sdtw_pytorch mentioned on GitHubpytorch report
yueyaog/TSGEM_Clustering mentioned on GitHubGPL-3.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 1 ran; 0 honoured the contract we drafted; 10 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · fixture could not drive it
10unverified

Licence: 3 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from 5 repositories linked to this paper, official or community; each sample names its own and says which. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

delannoy_num mblondel/soft-dtw/sdtw/path.py official repository unverified BSD-2-Clause (permissive) · 4f2a86831e92d61e · report
load_ucr mblondel/soft-dtw/sdtw/dataset.py official repository unverified BSD-2-Clause (permissive) · 57a33bcae3c2374a · report
sakoe_chiba_band lyprince/sdtw_pytorch/sdtw.py community (archive-listed) ran · fixture could not drive it fingerprinted no licence file found · pointer only · e1ffef61f9ff62a7 · report
dist_func_cos Maghoumi/DeepNAG/models/hausdorff_distance.py community (archive-listed) unverified MIT (permissive) · c542e2fb148a11f8 · report
distance_matrix khdlr/softdtw_jax/softdtw_jax/softdtw_jax.py community (archive-listed) unverified MIT (permissive) · f6de6e2b30a06bf5 · report
jacobean_product_squared_euclidean keonlee9420/Soft-DTW-Loss/sdtw_cuda_loss.py community (archive-listed) unverified MIT (permissive) · 2331123dca3def2c · report
jacobean_product_squared_euclidean lyprince/sdtw_pytorch/sdtw.py community (archive-listed) unverified no licence file found · pointer only · 1d66eaff37129b6a · report
masked_max Maghoumi/DeepNAG/models/hausdorff_distance.py community (archive-listed) unverified MIT (permissive) · 8f1d21b59b848f46 · report
masked_mean Maghoumi/DeepNAG/models/hausdorff_distance.py community (archive-listed) unverified MIT (permissive) · f405ce4fd7400a67 · report
pad_inf khdlr/softdtw_jax/softdtw_jax/softdtw_jax.py community (archive-listed) unverified MIT (permissive) · 05bf33cfc4c9c7cf · report
softmin lyprince/sdtw_pytorch/sdtw.py community (archive-listed) unverified no licence file found · pointer only · 3f0b3faa4c343689 · report

Tasks

Dynamic Time WarpingTime SeriesTime Series Analysis

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

DTW

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections