GithubHelp home page GithubHelp logo

xovee / last Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhycs/last

1.0 0.0 0.0 45 KB

Code for paper titled "Learning Latent Seasonal-Trend Representations for Time Series Forecasting" in NeurIPS 2022

License: Apache License 2.0

Python 100.00%

last's Introduction

LaST: Learning Latent Seasonal-Trend Representations for Time Series Forecasting

In this repository, we provide source code of LaST framework for reproductivity.

Dataset

We conducted extensive experiments on seven real-world benchmark datasets from four covering the categories of mainstream time series forecasting applications.

Please download from the following buttons and place them into datasets folder.

Usage

Requirements

The code was tested with python 3.8, pytorch 1.8.1, cudatookkit 10.2, and cudnn 7.6.5. Install the dependencies via Anaconda:

# create virtual environment
conda create --name LaST python=3.8

# activate environment
conda activate LaST

# install pytorch & cudatoolkit
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch-lts

# install other requirements
conda install numpy pandas

Run code

To train and evaluate LaST framework on a dataset, run the following command:

python run.py --data <dataset_name>  --features <forecasting_mode>  --seq_len <input_length>  --pred_len <pred_length>  --latent_size <latent_size>  --batch_size <batch_size>  --patience <patience>  --seed <random_seed>

The detailed descriptions about the arguments are as following:

Parameter name Description
dataset_name The dataset name can be selected from ["ETTh1", "ETTh2", "ETTm1", "ETTm2", "Exchange_rate", "Electricity", "Weather"]
forecasting_mode A value in ["S", "M"]. "S" denotes univariate forecasting while "M" denotes multivariate forecasting.
input_length The input (historical) sequence length, default is 201.
pred_length The output (forecasting) sequence length.
latent_size The dimension of latent representations, default is 128.
batch_size Batch size, default is 32.
patience The steps of early stop strategy in training.
random_seed The random seed.

Directory Structure

The code directory structure is shown as follows:

LaST
├── datasets  # seven datasets files
│   ├── ETTh1.csv
│   ├── ETTh2.csv
│   ├── ETTm1.csv
│   ├── ETTm2.csv
│   ├── electricity.csv
│   ├── exchange_rate.csv
│   └── weather.csv
├── expriments  # training, validation, and test code of LaST
│   ├── exp_basic.py
│   └── exp_LaST.py
├── models  # code of LaST and its dependencies
│   ├── LaST.py  # LaST main code
│   └── utils.py  # modules for LaST including autocorrelation, cort, etc.
├── utlis
│   ├── data_loader.py  # data loading and preprocessing code
│   ├── metrics.py  # metrics for evaluation
│   ├── timefeatures.py  # extract time-related features
│   └── tools.py  # tools for training, such as early stopping and learning rate controls 
├── LICENSE  # code license
├── run.py  # entry for model training, validation, and test 
└── README.md  # This file

last's People

Contributors

zhycs avatar

Stargazers

 avatar

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.