Dynamic time warping 2: Algorithm

Sdílet
Vložit
  • čas přidán 5. 09. 2024

Komentáře • 55

  • @joantarridavidal5274
    @joantarridavidal5274 Před 2 lety +21

    You deserve an award for explaining such a complex thing in an understandable way. I wish you a long and beatufiful life.

  • @jenniferlorenza6813
    @jenniferlorenza6813 Před 2 lety +20

    I was trying to understand DTW and found this. Such a clear, beautiful explanation. Thank you very much!

    • @kamperh
      @kamperh  Před 2 lety +7

      Very happy it helped! :)

  • @farsITTO
    @farsITTO Před 7 měsíci

    You have a gift for breaking complex topics into easy, clear chunks and explaining them! Kudos!

  • @crane71
    @crane71 Před 9 měsíci

    Such a beautiful explanation for such an intricately complex topic which has beautiful usages in real life world.
    Thanks a lot!

  • @rohitkumarnk8234
    @rohitkumarnk8234 Před 8 měsíci +1

    Great video @Herman. Appreciate the effort!

  • @akarshc6185
    @akarshc6185 Před 2 lety +1

    Thanks a lot, by far the best explanation on the topic

    • @kamperh
      @kamperh  Před 2 lety

      Very happy it helps! :)

  • @chenhaibin2010
    @chenhaibin2010 Před 2 lety +1

    awesome video. I was learning dynamic programming, and glad to see a time series application.

  • @mitch4556
    @mitch4556 Před 2 lety +1

    Thank you very much. By far the best and detailed explanation I've seen (and understand :) ) so far.

  • @mayursmahajan
    @mayursmahajan Před rokem

    Wow, such a complex topic and yet such a beautiful explanation. Very patiently explained. Thanks!

  • @djpaddyofficial
    @djpaddyofficial Před 2 lety +1

    Best explanation I saw so far. Thanks for making this video, now I really understand how this work and so I can finally describe it in my thesis.

  • @sabianhibbs1174
    @sabianhibbs1174 Před rokem

    I was kinda lost until 17:00 when the pin dropped! thank you for making this so understandable

  • @JavArButt
    @JavArButt Před 2 lety +1

    Thank you for the effort and time you spend in this - it really explains DTW.

  • @szymon7987
    @szymon7987 Před 2 lety +1

    Great explanation, thanks!

  • @rodolforodrigues9534
    @rodolforodrigues9534 Před 2 lety

    Fantastic! Thank you so much! The clearest explanation I've seen!! Congrats!!

  • @camila_braz
    @camila_braz Před 2 lety

    Excellent explanation, very clear! Thank you!

  • @SalmanAhmedShaikh
    @SalmanAhmedShaikh Před rokem

    Super easy to understand. great explanation. thanks a lot :)

  • @cw9249
    @cw9249 Před 2 lety

    im not smart enough to understand this intuitively from watching this video just once, but after some additional visualization on my own and reading the concept of "edit distance", it started to click

  • @robotiqueclem142
    @robotiqueclem142 Před 9 měsíci

    Very very very well explained

  • @qianyunwu221
    @qianyunwu221 Před 3 lety

    Thanks a lot for the detailed and clear explanation!

  • @gillbates9668
    @gillbates9668 Před rokem

    Thank you for such a great tutorial

  • @maurelaza-gnandji1716
    @maurelaza-gnandji1716 Před 2 lety

    Thank you for this very instructive video. At 12:54 I think D_i,j-1 should be D_1,4

    • @kamperh
      @kamperh  Před 2 lety +1

      You mean it should be D_{1,3}, but you are right that there's a mistake! Thanks a ton for catching it. I added it to the Errate list in the video comments. You can check and see if you agree!

    • @maurelaza-gnandji1716
      @maurelaza-gnandji1716 Před 2 lety

      @@kamperh sorry D_{1,3}.

  • @manjy5927
    @manjy5927 Před 2 lety

    This reminds me of Longest Common Subsequence problem

  • @husseinaly3118
    @husseinaly3118 Před 3 lety

    This is the first time I understand DTW ! very good and clear explanation. Thanks a lot.

    • @kamperh
      @kamperh  Před 3 lety +1

      Very very happy it helped! :)

  • @ashishrathore7783
    @ashishrathore7783 Před 3 lety

    Very well explained

    • @kamperh
      @kamperh  Před 3 lety

      Very happy it helped! :)

  • @AndyLee-xq8wq
    @AndyLee-xq8wq Před rokem

    very good tutorial! thx

  • @randb9378
    @randb9378 Před 2 lety

    Great video! Very informative. Quick question - when dealing with two time-series, can one be on another scale? (example one being one having values 0-100 and another from 10,000 to 50,000)

  • @fatemehmojab5555
    @fatemehmojab5555 Před 2 lety +1

    Thanks a lot for this playlist and your good explanation!
    In 14:05, you mentioned that there could be two options as an optimal path for one cell. Here that cell wasn't in the main path, but in general, does it make a difference in the final alignment path? Should we consider this in the algorithm and the code?

    • @kamperh
      @kamperh  Před 2 lety +2

      Very good question! First, when you are dealing with real continuous signals (like) speech, this is actually very unlikely to happen. With discrete sequences (e.g. when you have the edit distance), it happens a lot more. Second, if it does happen, it will affect your path (you actually will have a choice now), but both paths will have the same overall cost.
      I had to sleep on it to get an example, but imagine x = [0, 1, 1] and y = [0, 3, 3, 3]. You can quickly build up the matrix for yourself, and you will see that there are two equivalent paths (both with an overall cost of 6). In the one path, the last one 1 in x is aligned with the last two 3's in y. In the other path, the second 1 in x is aligned to the first two 3's in y. But it doesn't matter which one you pick, since both have the same overall cost. Hope that helps!

    • @fatemehmojab5555
      @fatemehmojab5555 Před 2 lety +1

      @@kamperh Thank you very much! the example was very helpful🙏

  • @ahmedhossam6595
    @ahmedhossam6595 Před 10 měsíci

    Good 🎉

  • @fathahimuthedath9778
    @fathahimuthedath9778 Před rokem

    Thank you. Very well explained. Is there any algorithm that can compare pattern of matrices.

  • @bleusorcoc1080
    @bleusorcoc1080 Před 3 měsíci

    Does this algorithm work with negative instance? I mean can i use vectors with both negative and postive values?

  • @ruili7941
    @ruili7941 Před 2 lety

    Interesting algrithum.

  • @zaidalmahmoud4272
    @zaidalmahmoud4272 Před 2 lety

    Thank you very much. Can I use DTW as evaluation metric for time series forecast?

  • @ericpenarium
    @ericpenarium Před 2 lety

    Wow. Amazing video!!! I realized that (Sakoe and Chiba 1978) propose a symmetric step pattern with a weight coefficient of 2 for the diagonal direction (D[i-1, j-1] + 2 * d[x_i, y_j]). This is the default implementation in the "dtw-python" library (they call it: 'symmetric2' or 'symmetricP0'). Your video is a such a good explanation and will be my preferred reference for sure. I wonder how the weight coefficient of 2 in the dtw-python library changes how the distance is ultimately calculated (I'm still pondering...perhaps it penalizes diagonal steps). [fyi: I tried your example signals in the dtw-library with the symmetricP0 step pattern and there is no difference in the cost matrix but that may differ with other complicated signals I assume]. Would you by chance have any thoughts on this? Thanks!

    • @kamperh
      @kamperh  Před 2 lety +1

      I've quickly skimmed the paper but probably not enough detail since I don't have a concrete answer. But here's one intuitive way of thinking why this would be a good idea: doing this basically says that, if you want to move diagonally, then to do this should be better than to take the two move steps: right+up or up+right. Stated differently, when you have the times-2, a diagonal move is basically two moves where you pay d[x_i, y_j] for each individual move. Does that make sense (at an intuitive level)? I should also add that if d[x_i, y_j] = 0 (which rarely happens in practice but does happen in my example), then the times-2 multiplier won't have any effect (2*0 = 0), which might be why you get exactly the same output. Hope this helps! :) Let me know if not and I'll think about it even more.

    • @ericpenarium
      @ericpenarium Před rokem

      This is very helpful. Thanks so much! (sorry for the late reply) 😅

  • @paulopires7535
    @paulopires7535 Před 3 lety

    At the end of the matrix, the smallest DTW points will just be summed, or summed and divided by the length of the DTW point vector? Thanks

    • @kamperh
      @kamperh  Před 3 lety +1

      Hey Paulo. In the "vanilla" DTW, the final DTW cost is just the sum of the costs along the DTW alignment path. But it is actually a good idea to normalize by the length of the path (in some way). I actually describe this in the last video in this "series" (check the playlist linked in the video comments); specifically, you can look at this video watching from around minute 11 onwards: czcams.com/video/QoL7drXt6EA/video.html.

  • @1ssbrudra
    @1ssbrudra Před rokem

    BEST EXPLANATION ON THE INTERNET! Please do one on the O(n) algorithm.

    • @tjmcmorrow8434
      @tjmcmorrow8434 Před rokem

      Can you link where I would find an O(n) for this?

  • @mardzj
    @mardzj Před rokem

    Why do we initialize with infinity ?

  • @djpaddyofficial
    @djpaddyofficial Před 2 lety

    by the way - what is the source of these versions of formulas you use in your presentation? I would like to cite it like this, because in other documents I feel like it is often described in much more complex way

    • @kamperh
      @kamperh  Před 2 lety

      Good question! I mostly formulated these myself, but at the end of the last video in this series I give the references that I used to make the videos: czcams.com/video/QoL7drXt6EA/video.html. Hope that helps!

    • @djpaddyofficial
      @djpaddyofficial Před 2 lety

      @@kamperh Thank you very much!

  • @JoellaAlberty-z5c
    @JoellaAlberty-z5c Před 3 dny

    Lopez Sharon Davis George Taylor Laura

  • @keretasenjaku
    @keretasenjaku Před rokem

    do you have an email or linkedin? sir @Herman Kamper?