Triplet loss Time series

22 views Asked by At

I am reading this paper and I am wondering how the triplet loss in general works regarding time series, positive samples and the context.

Let's say we have a dataset with 3 samples, one feature and a sequence length of 6 like here:

y1 = [1,3,4,7,5,2]
y2 = [1,2,3,4,5,6]
y3 = [9,8,4,6,2,1]

If I follow the logic of the given paper the triplets are generated like the following:

s_i = 6 # len of yi
s_pos = 3 # random len
s_ref = 3+2 # random between s_pos & s_i

x_ref = [1,2,3,4,5]
x_pos = [2,3,4]

...
x_1_neg = [3,4,7]

Now to reduce the loss we want to find the x_pos given the anchor x_ref. But isn't it easy for the encoder to find the right pair, since x_pos is included in x_ref whereas x_1_neg is not? Wouldn't it make more sense to give the encoder only the context around x_pos like [1,...,5]?

0

There are 0 answers