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

Data input during test process #58

Closed CK-TD closed 11 months ago

CK-TD commented 1 year ago

First, thanks for the valuable work! I noticed that in the exm_main.py file, specifically in the "test" class, the same Dataset_Custom class generated by the data_loader is used to load the test data, just like in the "train" class. During this process, it appears that the original dataset containing data of all time steps is utilized. Does this mean that the test process still relies on input data from the original dataset?
I ask because my current time series prediction task is an autoregressive process, where there is no more data input after the training phase. Instead, I have to rely on the model's previous output as input for iterative prediction. Therefore, I'm curious to know if the proposed model can handle such a task Thank you for your responsiveness and fast reply so far!

yuqinie98 commented 1 year ago

Hi! Thanks for your question. Currently the model is not auto-regressive. Instead it directly output all the future steps with input data given. See this paper: https://arxiv.org/abs/2205.13504, which shows that the "DMS" is better than "IMS".

CK-TD commented 1 year ago

Thanks for your quick reply! If DMS method relies on more input data than IMS method does, is it fair to compare their ability of prediction directly? Since the DMS method needs input data intermittently while the IMS method doesn't.

yuqinie98 commented 1 year ago

Hi, DMS and IMS will use the same amount of input data to generate the same amount of output data. DMS will be faster since the output is generated at once, and the average MSE will be smaller.