Closed weidenka closed 2 years ago
The path is the same for both dtws. When you look at the errors, you can see they come from the first element q[0]=0, p[0]=1, and the last element q[8]=8, p[8]=0.
The euclidean distance is abs(p[0]-q[0]) + abs(p[8]-q[8]) = 1 + 8 = 9 The square euclidean is (p[0]-q[0])(p[0]-q[0]) + (p[8]-q[8])(p[8]-q[8]) = 1 + 64 = 65
So the outputs are correct. The second assert is wrong. The second distance value is the sum of the squares of each individual euclidean element, not the square of the sum of euclideans.
I agree
I'm struggling understanding a very simple example. I boiled it down to the following test:
Since the paths are the same I would expect to that also the distances are the same. The correct Euclidean distance should be
sqrt(65)
(only first and last elements of the input vectors contribute). Since it is9
it looks like the Manhattan distance is used instead of the Euclidean distance.I have the feeling that I miss something simple. But could someone give me a hint?