diff --git a/dtw_minwarplag.ipynb b/dtw_minwarplag.ipynb index ca532d6bf13e0ce2c8c7497a475095ff6248ebc9..d8c3f2bf416d0e6118b0963d3b180c3594da69ad 100644 --- a/dtw_minwarplag.ipynb +++ b/dtw_minwarplag.ipynb @@ -158,7 +158,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "computation time of DTW 1 = 8.834073066711426\n" + "computation time of DTW 1 = 5.056027173995972\n" ] }, { @@ -215,8 +215,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "computation time of DTW 2 = 0.006272077560424805\n", - "computation time of classical optimal path = 0.0016927719116210938\n" + "computation time of DTW 2 = 0.023046016693115234\n", + "computation time of classical optimal path = 0.013571977615356445\n" ] }, { @@ -299,7 +299,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "computation time of minimum-warp optimal path = 0.01871490478515625\n" + "computation time of minimum-warp optimal path = 0.0059490203857421875\n" ] }, { @@ -425,6 +425,7 @@ "lags = np.zeros(pm_r.shape[0])\n", "i_lags = 0\n", "i_adiag = -pm_r.shape[0] + 1\n", + "step = 2\n", "\n", "while i_adiag <= pm_r.shape[0]: # iterate through anti-adiagonals\n", " \n", @@ -442,12 +443,14 @@ "\n", " lags[i_lags] = i_center - i_match \n", " \n", - " i_adiag += 2\n", + " i_adiag += step\n", + " step = 2\n", " i_lags += 1\n", " \n", " else: # see if there's anything in the next diagonal\n", " \n", " i_adiag += 1\n", + " step = 1\n", " \n", "plt.plot(lags)\n", "plt.title('pointwise lag');"