Home

Awesome

Mamba or Transformer for Time Series Forecasting? Mixture of Universals (MoU) Is All You Need <br><sub>Official PyTorch Implementation</sub>

arXiv 

<div align="center"> <figure> <img src="https://github.com/lunaaa95/mou/blob/main/figs/overview.png" alt="overview"> <figcaption>Overview of MoU</figcaption> </figure> </div>

💥 Our Paper

Our paper has been released on Arxiv. We introduce a new versatile model Mixture of Universals (MoU) to capture both short-term and long-term dynamics for enhancing perfomance in time series forecasting. MoU is composed of two novel designs: Mixture of Feature Extractors (MoF), an adaptive method designed to improve time series patch representations for short-term dependency, and Mixture of Architectures (MoA), which hierarchically integrates Mamba, FeedForward, Convolution, and Self-Attention architectures in a specialized order to model long-term dependency from a hybrid perspective. The proposed approach achieves state-of-the-art performance while maintaining relatively low computational costs.

The overall performance of MoU for long-term forecasting is summarized in the following Table (average performance). More detailed results can be found in our paper.

ModelOurs(MoU)ModernTCNPatchTSTDLinearS-Mamba
MetricMSEMAEMSEMAEMSEMAEMSEMAEMSEMAE
ETTh10.3970.4230.4040.4200.4130.4340.4230.4370.4500.456
ETTh20.3170.3730.3230.3780.3310.3790.4310.4470.3690.405
ETTm10.3480.3820.3540.3810.3520.3820.3570.3790.3660.396
ETTm20.2520.3150.2560.3160.2560.3170.2670.3320.2650.326
Weather0.2210.2620.2240.2670.2250.2640.2400.3000.2360.273
illness1.5000.7841.5190.7991.5130.8252.1691.0411.9770.890
electricity0.1570.2530.1570.2530.1590.2530.1770.2740.1660.262

⚡️ Preparation

Installation

Download code:

git clone https://github.com/lunaaa95/mou.git
cd mou

A suitable conda environment named mou can be created and activated with:

conda create -n mou python=3.8
conda activate mou
pip install -r requirement.txt

Dataset

Download datasets to folder ./dataset. You can download all datasets from Google Drive provided by Wu, H.

📍 Run

bash scripts/MoU/etth1.sh

bash scripts/MoU/etth2.sh

bash scripts/MoU/ettm1.sh

bash scripts/MoU/ettm2.sh

bash scripts/MoU/weather.sh

bash scripts/MoU/electricity.sh

bash scripts/MoU/illness.sh

🌟 Citation

@misc{peng2024mambatransformertimeseries,
      title={Mamba or Transformer for Time Series Forecasting? Mixture of Universals (MoU) Is All You Need}, 
      author={Sijia Peng and Yun Xiong and Yangyong Zhu and Zhiqiang Shen},
      year={2024},
      eprint={2408.15997},
      archivePrefix={arXiv},
      primaryClass={cs.LG},
      url={https://arxiv.org/abs/2408.15997}, 
}