mims-harvard / TFC-pretraining

Self-supervised contrastive learning for time series via time-frequency consistency
https://zitniklab.hms.harvard.edu/projects/TF-C/
MIT License
422 stars 78 forks source link

Why do we keep only one first feature in all datasets? #1

Closed inspirit closed 1 year ago

inspirit commented 2 years ago

Hello,

would you be so kind to explain why do you remove all features except first in all datasets? Does it mean current algorithm only works for univar? thank you

https://github.com/mims-harvard/TFC-pretraining/blob/6d0ce38664d511302249c1fcad4c49590fe6bca0/code/dataloader.py#L29

xiangzhang1015 commented 1 year ago

Hi,

As shown in our paper: scenarios 1, 2, and 4 are for univariate TS. However, the TFC model can work on multivariate TS as long as the contrastive encoder able to accept multiple channels (in our scenario 3). The current codes are for single-channel TS, but you can easily revise the code to apply it for multi-dimensional data.

Apolsus commented 1 year ago

It's not that simple, right? If you change the code to multi-channel, how do you define your constractive loss? How do you combine information from multiple channels into a single representation vector?

I spent almost half a day studying your code, and I found that there was a huge gap with the paper.