Code Monkey home page Code Monkey logo

dan's Introduction

DAN

We present DAN, the multivariate time series prediction model we detail in our paper, "Learning from Polar Representation: An Extreme-Adaptive Model for Long-Term Time Series Forecasting," which will be presented at AAAI 2024. If you make use of our code or data, please cite our paper.

@inproceedings{li2024learning,
  title={Learning from Polar Representation: An Extreme-Adaptive Model for Long-Term Time Series Forecasting},
  author={Li, Yanhong and Xu, Jack and Anastasiu, David},
  booktitle={Proceedings of the AAAI Conference on Artificial Intelligence},
  volume={38},
  number={1},
  pages={171--179},
  year={2024}
}

Preliminaries

Experiments were executed in an Anaconda 3 environment with Python 3.8.8. The following will create an Anaconda environment and install the requisite packages for the project.

conda create -n DAN python=3.8.8
conda activate DAN
conda install pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 -c pytorch
python -m pip install -r requirements.txt

Files organizations

Download the datasets from here and upzip the files in the data_provider directory. In the ./data_provider/datasets directory, there should now be 4 stream sensor (file names end with _S_fixed.csv) and 4 rain sensor (file names end with _R_fixed.csv) datasets.

Parameters setting

--stream_sensor: stream dataset file name. The file should be csv file.

--rain_sensor: rain dataset file name. The file should be csv file.

--train_volume: train set size.

--hidden_dim: hidden dim of lstm layers.

--cnn_dim: hidden dim of cnn layers.

--layer: number of layers.

--stack_types: model stacks specified for this sensor. It should be a stack of encoder, decoder and residue.

--r_shift: shift positions of rain hinter, set to 288 without any predicted rain value. Otherwise, set to 0~288 according to the length of known forecasted rain data.

--watershed: 1 if trained with rain info, else 0.

--model: model name, used to generate the pt file and predicted file names.

--mode: set it to 'train' or 'inference' with an existing pt_file.

--pt_file: if set, the model will be loaded from this pt file, otherwise check the file according to the assigned parameters.

--save: if save the predicted file of testset, set to 1, else 0.

--outf: default value is './output', the model will be saved in the train folder in this directory.

Refer to the annotations in run.py for other parameter settings. Default parameters for reproducing are set in the files (file names start with opt and end with .txt) under './models/'.

Training and Inferencing

Execute the Jupyter notebook experiments.ipynb to train models and conduct inferences on the test sets of the four stream datasets described in the associated paper.

The Jupyter notebook example.ipynb shows how to train a model via command line commands and use specific model functions to perform inference on the SFC sensor dataset.

dan's People

Contributors

yli2021 avatar davidanastasiu avatar

Stargazers

 avatar lee avatar 陈李伦 avatar  avatar  avatar Zhenwei Dong avatar  avatar

Watchers

Yongkang Chen avatar  avatar

dan's Issues

Unable to Create Conda Environment Due to PackagesNotFoundError

Description:
When attempting to create a Conda environment with Python version 3.8.8, the process fails with a PackagesNotFoundError. The error message indicates that the required Python version is not available from the current channels.

Error Message:

Retrieving notices: ...working... done
Channels:
 - defaults
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - python=3.8.8*

Current channels:

  - defaults

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Proposed Solution:
To resolve this issue, creating the environment again using the conda-forge channel. Run the following command:

conda create -n DAN python=3.8.8 -c conda-forge

AttributeError: 'DAN' object has no attribute 'compute_metrics'

@YLi2021 I encountered an error while executing main-Saratoga.ipynb. I reviewed the source code in this project and indeed couldn't find a method named "compute_metrics" in DAN.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[7], line 4
      2 from models.DAN_M import *
      3 model = DAN(opt,ds)
----> 4 metrics = model.compute_metrics(Inference_dir)
      5 print("RMSE: ", np.array(metrics[0][0]))
      6 print("MAPE: ", np.array(metrics[1][0]))

AttributeError: 'DAN' object has no attribute 'compute_metrics'
Screenshot 2024-04-30 at 8 47 24 PM

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.