yuqinie98 / PatchTST

An offical implementation of PatchTST: "A Time Series is Worth 64 Words: Long-term Forecasting with Transformers." (ICLR 2023) https://arxiv.org/abs/2211.14730
Apache License 2.0
1.37k stars 248 forks source link

about channels #79

Open agl71 opened 8 months ago

agl71 commented 8 months ago

Hi: I debug the sorce code by running electricity.sh and found that the parameter "individual" was set to 0, which means that no channel independent data was sent into Transformer backbone. But the result is coincide with Table-3 in the paper.

Is it means that test results in Table-3 of the paper are based on no channel independent?

Best regards;

namctin commented 8 months ago

Hi, if individual is set to True, then each channel will have its own linear embedding. Otherwise, they all share the same embedding layer. All the transformer backbone are shared in either case. You can look at the code here: https://github.com/yuqinie98/PatchTST/blob/204c21efe0b39603ad6e2ca640ef5896646ab1a9/PatchTST_supervised/layers/PatchTST_backbone.py#L97

ZZD-guardian commented 7 months ago

thanks a lot, i do have the same problems about that

mb-Ma commented 2 weeks ago

Hi, if individual is set to True, then each channel will have its own linear embedding. Otherwise, they all share the same embedding layer. All the transformer backbone are shared in either case. You can look at the code here:

https://github.com/yuqinie98/PatchTST/blob/204c21efe0b39603ad6e2ca640ef5896646ab1a9/PatchTST_supervised/layers/PatchTST_backbone.py#L97

The question is that the "self.individual" is set to False in every script, provided in official codes. BUT, the claims in the paper tell the performance with the setting "individual == true". They are inconsistent.