A General Optimization Framework for Dynamic Time Warping

Dave Deriso, Stephen Boyd
5/30/2019
43 citations
cs.LGmath.OCstat.ML

Official code: dderiso/gdtw (43 stars, Jupyter Notebook, last commit 2026-08-20).

Abstract

The goal of dynamic time warping is to transform or warp time in order to approximately align two signals together. We pose the choice of warping function as an optimization problem with several terms in the objective.

Show full abstract

The first term measures the misalignment of the time-warped signals. Two additional regularization terms penalize the cumulative warping and the instantaneous rate of time warping; constraints on the warping can be imposed by assigning the value +inf to the regularization terms. Different choices of the three objective terms yield different time warping functions that trade off signal fit or alignment and properties of the warping function. The optimization problem we formulate is a classical optimal control problem, with initial and terminal constraints, and a state dimension of one. We describe an effective general method that minimizes the objective by discretizing the values of the original and warped time, and using standard dynamic programming to compute the (globally) optimal warping function with the discretized values. Iterated refinement of this scheme yields a high accuracy warping function in just a few iterations. Our method is implemented as an open source Python package GDTW.

View on arXivView PDF

Code Implementations(1)

dderiso/gdtwOfficial100%

GDTW is a Python/C++ library that performs dynamic time warping. It is based on a paper by Dave Deriso and Stephen Boyd.

437Jupyter Notebook, PythonNov 20, 20213 months agoNOASSERTION
dynamic-programmingoptimizationtime-seriestime-series-analysis

Similar Papers

Cite this paper

@article{deriso2019general,
  title  = {A General Optimization Framework for Dynamic Time Warping},
  author = {Dave Deriso and Stephen Boyd},
  year   = {2019},
  eprint = {1905.12893},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/1905.12893}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/1905.12893.svg)](https://codeofpaper.com/paper/1905.12893)

Discussion