Git Product home page Git Product logo

san's Introduction

SAN (NeurIPS 2023)


This repo is the official Pytorch implementation of our NeurIPS 2023 paper: Adaptive Normalization for Non-stationary Time Series Forecasting: A Temporal Slice Perspective.

Introduction

Time series data suffer from a non-stationary issue where the statistical properties or the distributions of the data vary rapidly over time. We further argue that the distribution is inconsistent across compact time slices and such inconsistency is not just on a per-instance basis. To alleviate the impact of such property, we propose a model-agnostic normalization framework named SAN. SAN models the non-stationarity in the fine-grained temporal slices and explicitly learn to estimate future distributions, simplifying the the non-stationary forecasting task through divide and conquer.

framework

We conduct comparison experiments on 9 widely used datasets with mainstream forecasting backbones, we also compare the performance of SAN and other plug-and-play non-stationary methods.

Multivariate forecasting results:

multivariate

Comparison with other plug-and-play non-stationary methods:

compare

Usage

Environment and dataset setup

pip install -r requirements.txt
mkdir datasets

All the 9 datasets are available at the Google Driver provided by Autoformer. Many thanks to their efforts and devotion!

Running

We provide ready-to-use scripts for SAN enhanced backbone models.

sh run_linear.sh # scripts for DLinear
sh run_trms.sh # scripts for Transformers (Autoformer/FEDformer/Informer/Transformer)

Tuning

For other forecasting task and backbones, we can tune the only two parameters of SAN, period_len and station_lr, which presents $T$ in our paper and the learning rate of the statistics prediction module respectively.

Acknowledgement

This repo is built on the pioneer works. We appreciate the following GitHub repos a lot for their valuable code base or datasets:

Informer

Autoformer

DLinear

Citation

If you find this repository useful for your work, please consider citing it as follows:

@inproceedings{liu2023adaptive,
  title={Adaptive Normalization for Non-stationary Time Series Forecasting: A Temporal Slice Perspective},
  author={Liu, Zhiding and Cheng, Mingyue and Li, Zhi and Huang, Zhenya and Liu, Qi and Xie, Yanhu and Chen, Enhong},
  booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
  year={2023}
}

san's People

Contributors

icantnamemyself avatar

Stargazers

Dench avatar Simon Dräger avatar  avatar Xinhui Lin avatar  avatar Yuze Zhao avatar  avatar  avatar Song avatar  avatar Goodsol Lee avatar  avatar Jeongwhan Choi avatar Trung Hieu avatar zhangdoudou avatar  avatar  avatar Hyeokryeol Yang avatar dikar avatar fcqfcq avatar 纪鹏 avatar  avatar  avatar  avatar  avatar HyunGi Kim avatar Daniel Lassahn avatar Asif Rahman avatar Jianping Zhou avatar yzhid avatar  avatar Yuxuan Shu avatar  avatar  avatar Sungchul Hong avatar Jeremy Diaz avatar  avatar  avatar FlappyBear avatar Kailuo avatar T1 avatar Harry avatar Weida Wang avatar  avatar  avatar  avatar lunalhx avatar  avatar  avatar ghzhao avatar Chengsen Wang avatar Jiqian Yang avatar

Watchers

 avatar Kostas Georgiou avatar  avatar

Forkers

valeman qjsqjs

san's Issues

non_station_factor无效输入问题

作者你好,我在使用transformer类的方法进行复现时,发现这个non_station_factor似乎并没有输入到encoder内,也没有看到关于non_station_factor的计算方法,是否是我忽略了什么地方呢?
image
image
image

SAN和patchTST结合的问题

由于SAN是非重叠切片,而patchTST是重叠切片,请问在论文中提到的patchTST+SAN的对比实验中各个数据集的切片长度是多少呢?(我基于ETTh1数据集人为设置了12、16、48等多个长度,跑的效果反而比纯patchTST更差了,不确定是代码迁移问题还是切片长度问题),请问对于这个长度设置有做后续研究么?

除了导入数据集路径,并没有对代码进行任何修改,有以下报错

Traceback (most recent call last):
File "/content/drive/MyDrive/SAN-master/run_longExp.py", line 164, in
mse, mae = exp.test(setting)
File "/content/drive/MyDrive/SAN-master/exp/exp_main.py", line 349, in test
preds = np.array(preds)
ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (88,) + inhomogeneous part.
请问我该如何修改代码呢

The difference between paper and code.

您好,我在论文中的第3个公式中发现,无论是均值还是标准差的MLP,它们输入之一为 $\overline{x}^i$ ,即输入的规范化,原文公式如下:
屏幕截图 2024-05-28 154646
但在实现code中却是使用原始的输入(非规范化后的),即代码中的input而非norm_input,代码实现如下:
屏幕截图 2024-05-28 155524
请问这个地方的出入应遵循哪个版本(paper版本还是code版本)?

代码问题

  1. 首先,station_pretrain_epoch = 5 是否太小,网络能收敛吗?
  2. 没有判断station_model earlystop,导致early stop 失效,station_model将一直训练直到 station_pretrain_epoch
  3. 为什么每次同时调整两个学习率,这样开始训练预测网络的时候,学习率不会过小吗?

请教下数据集还原的问题

采用该模型做实验时,确实能够很明显地看到时序模型训练的优化,我想请教下,最终的预测结果能否还原到原来的数据维度(因为此前训练时采用了标准化)

关于非平稳的疑问

您好,我对于时间序列非平稳带来的问题一直存在一些疑惑,时间序列非平稳是指序列的统计信息随时间变化,可是这到底是如何影响神经网络模型的预测呢?神经网络预测输入的是历史序列,输出的是未来序列,只要这个映射关系是存在一定规律的,那么神经网络应该就能够在一定程度上学到这种关系,序列的非平稳是如何影响这种映射关系的呢?为什么平稳的序列就一定更好呢?(白噪声也是一种平稳序列,可是却完全无法预测。

exp_main.py中存在的代码逻辑错误

image image 213行到216行的代码是否不应该在else下? 反归一化过程与是否使用amp无关。 若代码逻辑属实有误是否影响了论文结果权威性?

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.