emadeldeen24 / TS-TCC

[IJCAI-21] "Time-Series Representation Learning via Temporal and Contextual Contrasting"
MIT License
357 stars 99 forks source link

there might be code error for augmentation? #17

Closed sinsa902 closed 1 year ago

sinsa902 commented 1 year ago

In strong augmentation, is it correct that pat[0,warp]? I think pat[:,warp] should be correct. Could you check below code?

for i, pat in enumerate(x):
    if num_segs[i] > 1:
        if seg_mode == "random":
            split_points = np.random.choice(x.shape[2] - 2, num_segs[i] - 1, replace=False)
            split_points.sort()
            splits = np.split(orig_steps, split_points)
        else:
            splits = np.array_split(orig_steps, num_segs[i])
        warp = np.concatenate(np.random.permutation(splits)).ravel()
        ret[i] = pat[0,warp]
    else:
        ret[i] = pat
return torch.from_numpy(ret)
emadeldeen24 commented 1 year ago

It should be correct according to my settings.

Blues-He commented 1 year ago

@sinsa902 in my opinion,maybe you are right.because it only use one channel.or Maybe I missed something.