Skip to content

yisongfu/PS_Loss

 
 

Repository files navigation

Patch-wise Structural Loss for Time Series Forecasting

✨ Abstract

model Time-series forecasting has gained significant attention in deep learning due to its crucial role in various domains. However, most existing forecasting models rely heavily on point-wise loss functions like Mean Square Error, which treat each time step independently and neglect the structural dependencies inherent in time series data, making it challenging to capture complex temporal patterns accurately. To address these challenges, we propose a novel Patch-wise Structural PS loss, designed to enhance structural alignment by comparing time series at the patch level. Through leveraging local statistical properties, such as correlation, variance, and mean, PS loss captures nuanced structural discrepancies overlooked by traditional point-wise losses. Furthermore, it integrates seamlessly with point-wise loss, simultaneously addressing local structural inconsistencies and individual time-step errors. PS loss establishes a novel benchmark for accurately modeling complex time series data and provides a new perspective on time series loss function design.

✨ Usage

The PS loss is implemented in the ./[model_name]/exp/exp_main.py and ./[model_name]/exp/exp_long_term_forecasting.py files.

  1. Install Pytorch and necessary dependencies.
pip install -r requirements.txt
  1. You can download the datasets from Google Drive and store it into datasets folder.
  2. Train the model and evaluate. We provide the experiment scripts of all backbones under the folder ./scripts/. You can reproduce the results using the following commands. Results will be stored in ./logs/PS/ and ./logs/MSE/.
cd iTransformer

# Use only MSE loss to train the model
bash ./scripts/ETTh1.sh 0

# Use PS loss to train the model
bash ./scripts/ETTh1.sh 1

💖 Acknowledgements

We appreciate the following GitHub repos a lot for their valuable code and efforts.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 91.2%
  • Shell 8.8%