Skip to content

HaiweiZuo/LSCodec2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LSCodec

A Time series long-short term codec for compression and representation

This repository supplements our paper "LSCodec: A Time series long-short term codec for compression and representation".

TODO

  • Implement of LSCodec model
  • Training scripts and configs
  • Downstream task scripts
  • Pre-trained checkpoints
  • how to cite our paper

Framework

image

Environment Setup

Create and activate a virtual environment to work in, e.g. using env:

python -m venv your_env_lscodec 
your_env_lscodec/Scripts/activate  

Install CUDA and PyTorch 1.13. For CUDA 11.6, this would look like:

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116

Install the remaining requirements with pip:

pip install -r requirements.txt

The proposed framework is high relied on vector_quantize, it is an excellent VQ library.

Datasets

LSCodec supports Multi-Channel regular Time Series Sequences. For data preparing, we follow DTAAN scripts for data normalization and train/valid splitting.

python ./preprocess.py <datasets>  

where is space separated list of datasets like 'synthetic', 'SMD', 'SWaT', 'SMAP', 'MSL', 'WADI', 'MSDS', 'UCR', 'MBA', 'NAB' ... The data should be placed in './data' folder. And the preprocessed data will be generated in './processed' folder. Considering that datasets is not allowed for distribution, we recommand to access dataset by its official website.

Training

For CPU training

python ./train.v1.py --task lscodec --config ./config/config_lscodec_xxx.toml --force_cpu  

For single GPU training

python ./train.v1.py --task lscodec --config ./config/config_lscodec_xxx.toml  

For Multi-GPU training, we build our training code upon Accelerate for multi-gpu training, you need to prepare your gpu-env configurations.

CUDA_VISIBLE_DEVICES=xxxx accelerate launch --config_file ./your_accelerate_config  ./train.v1.py --task lscodec --config ./config/config_lscodec_xxx.toml    

License

BSD-3-Clause.
Copyright (c) 2024, Haiwei Zuo.
All rights reserved. See License file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages