Skip to content

Implementation of Time Series Generation via GANs using PyTorch

License

Notifications You must be signed in to change notification settings

dhutexas/Time-Series-Generation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Time-Series-Generation

0. Overview

This repository provides a simple project on time series generation using GAN and PyTorch.

What this repository supports follows:

  • Implementation of different models, LSTM-based and Conv-based models, for comparison
  • Implementation of different loss functions, L2 and WGAN-GP, for comparsion
  • Calculation of metrics proposed by TimeGAN (NeurIPS 2019) for quantitative evaluation

The models show bad performance. The performance depends upon the characteristic of dataset and selection of hyper-parameters heavily.

The dataset used here is Appliances Energy Prediction Data Set and can be found here.

1. Quantitative Evaluation

Model Predictive Score↓ Discriminative Score↓
LSTM-based Generator with L2 Loss 0.0582 N/A
Conv-based Generator with L2 Loss 0.0466 N/A

The used metrics are simply adopted from the official repository of TimeGAN (NeurIPS 2019).

2. Qualitative Evaluation

LSTM-based Generator with L2 Loss Conv-based Generator with L2 Loss

3. Run the Codes

1) Prepare Data

Please place the file to ./data/ and specify column that you want to generate.

2) Train

If you want to train Conv-based Generator with WGAN-GP loss,

python main.py --mode 'train' --model 'conv' --criterion 'wgangp'

To handle more arguments, you can refer to here.

3) Test

You can save plot and csv files then derive metrics on the test set. Please install tensorflow 1.15 to obtain corresponding metrics.

python main.py --mode 'test'

References

Development Environment

- Ubuntu 18.04 LTS
- NVIDIA GFORCE RTX 3090
- CUDA 10.2
- torch 1.6.0
- torchvision 0.7.0
- tensorflow 1.15
- etc

About

Implementation of Time Series Generation via GANs using PyTorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages