GithubHelp home page GithubHelp logo

hank0626 / pdf Goto Github PK

View Code? Open in Web Editor NEW
91.0 3.0 8.0 775 KB

An official implementation of "Periodicity Decoupling Framework for Long-term Series Forecasting" (ICLR 2024)

License: GNU Affero General Public License v3.0

Shell 18.86% Python 81.14%
decouple fourier-transform periodicity time-series time-series-forecasting transformer

pdf's Introduction

Periodicity Decoupling Framework for Long-term Series Forecasting 🚀

📰 News

  • [2024-01-15] 🎉 Our paper has been accepted by ICLR 2024.

🌟 Results

Quantitatively, compared with Transformer-based models, PDF(720) yields an overall 14.59% reduction in MSE and 10.77% reduction in MAE. Compared with CNN-based models, PDF(720) yields an overall 24.61% reduction in MSE and 19.91% reduction in MAE. Compared with Linear-based models, PDF(720) yields an overall 7.05% reduction in MSE and 5.51% reduction in MAE.

🛠 Prerequisites

Ensure you are using Python 3.9 and install the necessary dependencies by running:

pip install -r requirements.txt

📊 Prepare Datastes

Begin by downloading the required datasets. All datasets are conveniently available at Autoformer. Create a separate folder named ./dataset and neatly organize all the csv files as shown below:

dataset
└── electricity.csv
└── ETTh1.csv
└── ETTh2.csv
└── ETTm1.csv
└── ETTm2.csv
└── traffic.csv
└──  weather.csv

💻 Training

All scripts are located in ./scripts/PDF. Choose from two historical input lengths: 336 and 720. For instance, to train a model using the ETTh2 dataset with an input length of 720, simply run:

sh ./scripts/PDF/720/ETTh2.sh

After training:

  • Your trained model will be safely stored in ./checkpoints.
  • Visualization outputs are available in ./test_results.
  • Numerical results in .npy format can be found in ./results.
  • A comprehensive summary of quantitative metrics is accessible in ./results.txt.

📚 Citation

If you find this repo useful, please consider citing our paper as follows:

@article{dai2024period,
  title={Periodicity Decoupling Framework for Long-term Series Forecasting},
  author={Dai, Tao and Wu, Beiliang and Liu, Peiyuan and Li, Naiqi and Bao, Jigang and Jiang, Yong and Xia, Shu-Tao},
  journal={International Conference on Learning Representations},
  year={2024}
}

🙏 Acknowledgement

Special thanks to the following repositories for their invaluable code and datasets:

📩 Contact

If you have any questions, please contact [email protected] or submit an issue.

pdf's People

Contributors

hank0626 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pdf's Issues

代码报错

D:\anaconda\envs\py38\python.exe H:\study\data2\PDF-main\run_longExp.py
Traceback (most recent call last):
File "H:\study\data2\PDF-main\run_longExp.py", line 159, in
exp = Exp(args) # set experiments
File "H:\study\data2\PDF-main\exp\exp_main.py", line 27, in init
super(Exp_Main, self).init(args)
File "H:\study\data2\PDF-main\exp\exp_basic.py", line 10, in init
self.model = self._build_model().to(self.device)
File "H:\study\data2\PDF-main\exp\exp_main.py", line 40, in _build_model
model = model_dict[self.args.model].Model(self.args).float()
File "H:\study\data2\PDF-main\models\PDF.py", line 53, in init
self.model = PDF_backbone(c_in=c_in, context_window=context_window, target_window=target_window,
File "H:\study\data2\PDF-main\layers\PDF_backbone.py", line 36, in init
self.kernel_list = [(n, patch_len[i]) for i, n in enumerate(self.period_len)]
File "H:\study\data2\PDF-main\layers\PDF_backbone.py", line 36, in
self.kernel_list = [(n, patch_len[i]) for i, n in enumerate(self.period_len)]
IndexError: list index out of range
Args in experiment:
Namespace(activation='gelu', add=False, affine=0, attn_dropout=0.05, batch_size=16, c_out=7, checkpoints='./checkpoints/', d_ff=2048, d_layers=1, d_model=512, data='ETT-small', data_path='ETTh1.csv', dec_in=7, decomposition=0, des='test', devices='0', distil=True, do_predict=False, dropout=0.05, e_layers=2, embed='timeF', embed_type=0, enc_in=7, factor=1, fc_dropout=0.0, features='M', freq='h', gpu=0, head_dropout=0.0, individual=0, is_training=1, itr=2, kernel_list=[3, 7, 9], kernel_size=25, label_len=48, learning_rate=0.0001, log='./logs/LongForecasting/PatchTST_Electricity_336_96.log', loss='mse', lradj='type3', model='PDF', model_id='test', moving_avg=25, n_heads=8, num_workers=10, output_attention=False, padding_patch='end', patch_len=[16], patience=100, pct_start=0.3, period=[24, 12], pred_len=96, random_seed=2021, revin=1, root_path='./dataset/ETT-small/', seq_len=96, serial_conv=False, stride=None, subtract_last=0, target='OT', test_flop=False, train_epochs=100, use_amp=False, use_gpu=True, use_multi_gpu=False, wo_conv=False)
Use GPU: cuda:0

您好,代码一直报错,运行不了,麻烦能看一下吗?

help,Please

May I ask what problems this model mainly solves in time series forecasting? This is what my teacher asked me. I am not sure. Please help.

kernel_list的选取与周期的定义

您好,作者大大,在代码中没看到确定在周期的代码呢?还有一个问题kernel_list的大小是怎么确定的啊?可以麻烦您解答一下吗?谢谢

frequency selection

Hello, I would like to ask where the "frequency selection" mentioned in the paper is in the code? I didn't find it in the official code implementation

特定数据集超参数的选取策略

您好,请问一下模型中几个主要参数 period、patch_len、stride 有大致的选取原则吗?比如傅里叶变换的高频是如何跟参数对应的,应该选择几个参数,参数之间有没有相关的关系。

predict_merge

Hello,when I use PDF, an error come up here.

How to define the "predict_merge" in model(Autoformer, Informer and Transformer)?

We need to use "Parser" to add the argument — "predict_merge" firstly before using PDF,right?

代码问题

if [ ! -d "./logs" ]; then
mkdir ./logs
fi

if [ ! -d "./logs/LongForecasting" ]; then
mkdir ./logs/LongForecasting
fi

model_name=PDF
root_path_name=./dataset/ETT-small
data_path_name=ETTh1.csv
model_id_name=ETTh1
data_name=ETTh1

random_seed=2021

seq_len=720
for pred_len in 96 192
do
python -u run_longExp.py
--random_seed 2021
--is_training 1
--root_path ./dataset/
--data_path ETTh1.csv
--model_id ETTh1''$seq_len''$pred_len
--model PDF
--data ETTh1
--features M
--seq_len $seq_len
--pred_len $pred_len
--enc_in 7
--e_layers 3
--n_heads 4
--d_model 16
--d_ff 128
--dropout 0.25
--fc_dropout 0.15
--kernel_list 3 7 11
--period 24
--patch_len 1
--stride 1
--des Exp
--pct_start 0.2
--train_epochs 100
--patience 10
--itr 1 --batch_size 128 --learning_rate 0.0001 >logs/LongForecasting/$model_name''$model_id_name''$seq_len'_'$pred_len.log
done

for pred_len in 336 720
do
python -u run_longExp.py
--random_seed 2021
--is_training 1
--root_path ./dataset/
--data_path ETTh1.csv
--model_id ETTh1''$seq_len''$pred_len
--model PDF
--data ETTh1
--features M
--seq_len $seq_len
--pred_len $pred_len
--enc_in 7
--e_layers 3
--n_heads 4
--d_model 16
--d_ff 128
--dropout 0.5
--fc_dropout 0.25
--kernel_list 3 7 11
--period 24
--patch_len 1
--stride 1
--des Exp
--pct_start 0.2
--train_epochs 100
--patience 10
--itr 1 --batch_size 128 --learning_rate 0.00025 >logs/LongForecasting/$model_name''$model_id_name''$seq_len'_'$pred_len.log
done

您好运行这个.sh文件后报如下错误:D:\anaconda\envs\py38\python.exe: can't open file 'run_longExp.py': [Errno 2] No such file or directory 需要把这个run_longExp.py文件放到哪里吗?
麻烦您了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.