1 Introduction
-
To the best of our knowledge, we propose the first time-series generation model that relies on self-attention to generate realistic synthetic data for time-series forecasting. Precisely, we leverage the sparse self-attention layer to build a fully attentional generative model that is not only capable of accessing all historical input steps regardless of the time-series length but is also supported by supervision from the original data.
-
We design a joint framework for time-series generation. Our approach is more generic than any sequential generative model, as it can handle regular and irregular time-series data.
-
Experimental results prove that the SparseGAN model consistently outperforms all baseline models with an error reduction of around 15% over the former best model for both regular and irregular time-series data.
-
We further show that the time series synthesized from our model can be applied to other tasks, such as data augmentation and data substitution in low-data regimes for training better time-series forecasting models.
2 Related work
3 Problem formulation
4 The proposed model: SparseGAN
4.1 Supervision network
4.2 Generation network
4.3 End-to-end joint training
5 Experiments
5.1 Datasets
Dataset | Sequences | Dimension | Average length |
---|---|---|---|
Sines waves | 10,000 | 5 | 24 points |
Google stocks | 3686 | 6 | 22 days |
Energy appliances | 19,711 | 29 | 24 h |
Power consumption | 20,752 | 9 | 47 months |
Air quality | 935 | 15 | One year |
5.2 Baseline models
5.3 Evaluation
6 Results and discussion
6.1 Generated data fidelity
Forecasting model | Generative model | Datasets | ||||
---|---|---|---|---|---|---|
Sine waves | Google stocks | Energy appliances | Air quality | Power consumption | ||
LSTM | No augmentation | 0.1431 ± 0.0018 | 0.3215 ± 0.0008 | 0.2897 ± 0.0016 | 0.3282 ± 0.0008 | 0.2965 ± 0.0004 |
SparseGAN | 0.\(\varvec{0181 \pm 0.0008}\) | \(\varvec{0.1412 \pm 0.0006}\) | \(\varvec{0.1721 \pm 0.0008}\) | \(\varvec{0.1821 \pm 0.0008}\) | \(\varvec{0.1642 \pm 0.0008}\) | |
TimeGAN | \(\underline{0.0202 \pm 0.0008}\) | \(\underline{0.1573 \pm 0.0008}\) | \(\underline{0.1832 \pm 0.0008}\) | \(\underline{0.2077 \pm 0.0008}\) | 0.\(\underline{1891 \pm 0.0004}\) | |
T-CGAN | 0.0249 ± 0.0012 | 0.2192 ± 0.0006 | 0.1965 ± 0.0006 | 0.2379 ± 0.0008 | 0.2094 ± 0.0006 | |
RCGAN | 0.0410 ± 0.0008 | 0.2598 ± 0.0012 | 0.2039 ± 0.0006 | 0.2588 ± 0.0006 | 0.2296 ± 0.0008 | |
C-RNN-GAN | 0.0487 ± 0.0006 | 0.2881 ± 0.0012 | 0.2441 ± 0.0012 | 0.2778 ± 0.0008 | 0.2442 ± 0.0012 | |
T-forcing | 0.0508 ± 0.0008 | 0.2605 ± 0.0008 | 0.2189 ± 0.0006 | 0.2390 ± 0. 0012 | 0.2194 ± 0.0014 | |
P-forcing | 0.0497 ± 0.0008 | 0.3092 ± 0.0006 | 0.2935 ± 0.0006 | 0.2779 ± 0.0006 | 0.2575 ± 0.0014 | |
WaveNet | 0.0509 ± 0.0011 | 0.2912 ± 0.0012 | 0.2878 ± 0.0006 | 0.2714 ± 0.0008 | 0.2506 ± 0.0014 | |
WaveGAN | 0.0526 ± 0.0006 | 0.2592 ± 0.0006 | 0.2738 ± 0.0008 | 0.2648 ± 0.0008 | 0.2494 ± 0.0004 | |
LSTnet | No augmentation | 0.1429 ± 0.0018 | 0.3688 ± 0.0008 | 0.2884 ± 0.0016 | 0.2977 ± 0.0008 | 0.2862 ± 0.0004 |
SparseGAN | \(\varvec{0.0154 \pm 0.0008}\) | \(\varvec{0.1282 \pm 0.0006}\) | \(\varvec{0.1715 \pm 0.0008}\) | \(\varvec{0.1687 \pm 0.0008}\) | \(\varvec{0.1634 \pm 0.0008}\) | |
TimeGAN | \(\underline{0.0172 \pm 0.0008}\) | \(\underline{0.1472 \pm 0.0006}\) | \(\underline{0.1827 \pm 0.0008}\) | \(\underline{0.1892 \pm 0.0008}\) | \(\underline{0.1882 \pm 0.0004}\) | |
T-CGAN | 0.0244 ± 0.0008 | 0.2078 ± 0.0008 | 0.1935 ± 0.0008 | 0.2098 ± 0.0008 | 0.2014 ± 0.0004 | |
RCGAN | 0.0477 ± 0.0006 | 0.2504 ± 0.0008 | 0.2019 ± 0.0008 | 0.2302 ± 0.0008 | 0.2219 ± 0.0006 | |
C-RNN-GAN | 0.0678 ± 0.0008 | 0.2717 ± 0.0006 | 0.2371 ± 0.0008 | 0.2586 ± 0.0008 | 0.2403 ± 0.0004 | |
T-forcing | 0.0477 ± 0.0012 | 0.2491 ± 0.0012 | 0.2079 ± 0.0006 | 0.2294 ± 0.0008 | 0.2094 ± 0.0004 | |
P-forcing | 0.0475 ± 0.0008 | 0.2982 ± 0.0008 | 0.2765 ± 0.0008 | 0.2704 ± 0.0008 | 0.2414 ± 0.0004 | |
WaveNet | 0.0578 ± 0.0008 | 0.2795 ± 0.0006 | 0.2691 ± 0.0008 | 0.2696 ± 0.0008 | 0.2456 ± 0.0004 | |
WaveGAN | 0.0577 ± 0.0014 | 0.2281 ± 0.0006 | 0.2545 ± 0.0008 | 0.2516 ± 0.0008 | 0.2424 ± 0.0004 |
Forecasting model | Generative model | Datasets | ||||
---|---|---|---|---|---|---|
Sine waves | Google stocks | Energy appliances | Air quality | Power consumption | ||
LSTM | No augmentation | 0.1352 ± 0.0018 | 0.2652 ± 0.0008 | 0.2859 ± 0.0016 | 0.3175 ± 0.0008 | 0.1942 ± 0.0004 |
SparseGAN | \(\varvec{0.0177 \pm 0.0006}\) | \(\varvec{0.1311 \pm 0.0006}\) | \(\varvec{0.1719 \pm 0.0008}\) | \(\varvec{0.1858 \pm 0.0008}\) | \(\varvec{0.0684 \pm 0.0008}\) | |
TimeGAN | \(\underline{0.0198 \pm 0.0014}\) | \(\underline{0.1556 \pm 0.0006}\) | \(\underline{0.1816 \pm 0.0008}\) | \(\underline{0.2214 \pm 0.0008}\) | \(\underline{0.0882 \pm 0.0006}\) | |
T-CGAN | 0.0206 ± 0.0012 | 0.2071 ± 0.0006 | 0.1932 ± 0.0012 | 0.2276 ± 0.0006 | 0.0984 ± 0.0006 | |
RCGAN | 0.0329 ± 0.0014 | 0.2366 ± 0.0006 | 0.1989 ± 0.0008 | 0.2374 ± 0.0006 | 0.1094 ± 0.0012 | |
C-RNN-GAN | 0.0356 ± 0.0008 | 0.2573 ± 0.0006 | 0.2288 ± 0.0014 | 0.2346 ± 0.0006 | 0.1105 ± 0.0014 | |
T-forcing | 0.0485 ± 0.0008 | 0.2583 ± 0.0006 | 0.2529 ± 0.0006 | 0.2464 ± 0.0008 | 0.1291 ± 0.0006 | |
P-forcing | 0.0465 ± 0.0006 | 0.2415 ± 0.0006 | 0.2489 ± 0.0014 | 0.2374 ± 0.0006 | 0.1247 ± 0.0012 | |
WaveNet | 0.0473 ± 0.0008 | 0.2681 ± 0.0006 | 0.2429 ± 0.0012 | 0.2377 ± 0.0008 | 0.1307 ± 0.0012 | |
WaveGAN | 0.0507 ± 0.0012 | 0.2792 ± 0.0006 | 0.2469 ± 0.0008 | 0.2476 ± 0.0006 | 0.1348 ± 0.0006 | |
LSTnet | No augmentation | 0.2344 ± 0.0018 | 0.2625 ± 0.0014 | 0.2747 ± 0.0016 | 0.2669 ± 0.0008 | 0.1837 ± 0.0004 |
SparseGAN | \(\varvec{0.0149 \pm 0.0006}\) | \(\varvec{0.1293 \pm 0.0006}\) | 0.\(\varvec{1719 \pm 0.0008}\) | \(\varvec{0.1668 \pm 0.0008}\) | \(\varvec{0.0515 \pm 0.0008}\) | |
TimeGAN | \(\underline{0.0168 \pm 0.0008}\) | \(\underline{0.1451 \pm 0.0008}\) | \(\underline{0.1808 \pm 0.0008}\) | \(\underline{0.1887 \pm 0.0006}\) | \(\underline{0.0778 \pm 0.0006}\) | |
T-CGAN | 0.0192 ± 0.0006 | 0.1973 ± 0.0008 | 0.1942 ± 0.0008 | 0.2091 ± 0.0008 | 0.0914 ± 0.0006 | |
RCGAN | 0.0289 ± 0.0006 | 0.2281 ± 0.0006 | 0.2042 ± 0.0008 | 0.2124 ± 0.0014 | 0.1029 ± 0.0008 | |
C-RNN-GAN | 0.0295 ± 0.0008 | 0.2473 ± 0.0008 | 0.2139 ± 0.0008 | 0.2176 ± 0.0012 | 0.1090 ± 0.0006 | |
T-forcing | 0.0435 ± 0.0014 | 0.2496 ± 0.0006 | 0.2335 ± 0.0006 | 0.2432 ± 0.0008 | 0.1114 ± 0.0012 | |
P-forcing | 0.0408 ± 0.0014 | 0.2631 ± 0.0008 | 0.2439 ± 0.0012 | 0.2392 ± 0.0006 | 0.1261 ± 0.0014 | |
WaveNet | 0.0412 ± 0.0012 | 0.2614 ± 0.0006 | 0.2405 ± 0.0006 | 0.2365 ± 0.0012 | 0.1282 ± 0.0008 | |
WaveGAN | 0.0487 ± 0.0012 | 0.2666 ± 0.0006 | 0.2491 ± 0.0008 | 0.2456 ± 0.0012 | 0.1317 ± 0.0014 |
Forecasting model | Generative model | Datasets | ||||
---|---|---|---|---|---|---|
Sine waves | Google stocks | Energy appliances | Air quality | Power consumption | ||
LSTM | SparseGAN | \(\varvec{0.0813 \pm 0.0026}\) | \(\varvec{0.0362 \pm 0.012}\) | \(\varvec{0.2453 \pm 0.0007}\) | 0.\(\varvec{4576 \pm 0.006}\) | \(\varvec{0.2932 \pm 0.016}\) |
TimeGAN | \(\underline{0.0937 \pm 0.0016}\) | \(\underline{0.0384 \pm 0.0002}\) | \(\underline{0.2691 \pm 0.0004}\) | \(\underline{0.4686 \pm 0.0018}\) | \(\underline{0.3141 \pm 0.0016}\) | |
T-CGAN | 0.0948 ± 0.0014 | 0.0388 ± 0.0012 | 0.2736 ± 0.0016 | 0.4776 ± 0.0012 | 0.3172 ± 0.0012 | |
RCGAN | 0.0973 ± 0.0019 | 0.0404 ± 0.0014 | 0.2926 ± 0.0005 | 0.5171 ± 0.0014 | 0.3232 ± 0.0006 | |
C-RNN-GAN | 0.1272 ± 0.0014 | 0.0386 ± 0.0012 | 0.4831 ± 0.0015 | 0.5148 ± 0.0008 | 0.3335 ± 0.0008 | |
T-forcing | 0.1507 ± 0.0004 | 0.0388 ± 0.0016 | 0.3159 ± 0.0015 | 0.5576 ± 0.0018 | 0.3432 ± 0.0012 | |
P-forcing | 0.1164 ± 0.0008 | 0.0436 ± 0.0012 | 0.3036 ± 0.0006 | 0.5436 ± 0.0008 | 0.3515 ± 0.0014 | |
WaveNet | 0.1174 ± 0.0016 | 0.0428 ± 0.0014 | 0.3118 ± 0.0015 | 0.5561 ± 0.0018 | 0.3532 ± 0.0014 | |
WaveGAN | 0.1344 ± 0.0013 | 0.0412 ± 0.0011 | 0.3078 ± 0.0007 | 0.5496 ± 0.0006 | 0.3572 ± 0.0012 | |
Real data | 0.0772 ± 0.0014 | 0.0352 ± 0.0018 | 0.2426 ± 0.0014 | 0.4535 ± 0.0018 | 0.2916 ± 0.0018 | |
LSTnet | SparseGAN | \(\varvec{0.0812 \pm 0.0016}\) | \(\varvec{0.0344 \pm 0.0012}\) | \(\varvec{0.2284 \pm 0.0017}\) | \(\varvec{0.4536 \pm 0.0006}\) | \(\varvec{0.2769 \pm 0.0016}\) |
TimeGAN | \(\underline{0.0937 \pm 0.0006}\) | \(\underline{0.0352 \pm 0.0014}\) | \(\underline{0.2366 \pm 0.0012}\) | \(\underline{0.4589 \pm 0.0008}\) | \(\underline{0.2898 \pm 0.0014}\) | |
T-CGAN | 0.0948 ± 0.0014 | 0.0358 ± 0.0016 | 0.2874 ± 0.0018 | 0.4618 ± 0.0008 | 0.2977 ± 0.0012 | |
RCGAN | 00.0973 ± 00.0019 | 00.0368 ± 00.0014 | 00.4672 ± 00.0014 | 00.4629 ± 00.0008 | 00.3112 ± 0.0012 | |
C-RNN-GAN | 0.1274 ± 0.0004 | 0.0368 ± 0.0004 | 0.3092 ± 0.0016 | 0.4621 ± 0.0014 | 0.3158 ± 0.0008 | |
T-forcing | 0.1501 ± 0.0004 | 0.0368 ± 0.0018 | 0.3024 ± 0.0008 | 0.4632 ± 0.0008 | 0.3262 ± 0.0009 | |
P-forcing | 0.1162 ± 0.0008 | 0.0365 ± 0.0014 | 0.3039 ± 0.0018 | 0.4638 ± 0.0018 | 0.3369 ± 0.0011 | |
WaveNet | 0.1174 ± 0.0006 | 0.0368 ± 0.0016 | 0.3054 ± 0.0007 | 0.4643 ± 0.0014 | 0.3412 ± 0.0014 | |
WaveGAN | 0.1342 ± 0.0013 | 0.0386 ± 0.0001 | 0.3026 ± 0.0012 | 0.4648 ± 0.0008 | 0.3437 ± 0.0026 | |
Real data | 0.0743 ± 0.0016 | 0.0342 ± 0.0008 | 0.2191 ± 0.0008 | 0.4508 ± 0.0008 | 0.2748 ± 0.0006 |
Generative model | Datasets | ||||
---|---|---|---|---|---|
Sine waves | Google stocks | Energy appliances | Air quality | Power consumption | |
SparseGAN | \(\varvec{0.0091 \pm 0.0006}\) | \(\varvec{0.0822 \pm 0.0026}\) | \(\varvec{0.1624 \pm 0.0008}\) | \(\varvec{0.3862 \pm 0.0016}\) | \(\varvec{0.2926 \pm 0.0024}\) |
TimeGAN | \(\underline{0.0118 \pm 0.0008}\) | \(\underline{0.1026 \pm 0.0021}\) | \(\underline{0.2764 \pm 0.0012}\) | \(\underline{0.4026 \pm 0.0012}\) | \(\underline{0.3066 \pm 0.0018}\) |
T-CGAN | 0.2292 ± 0.0006 | 0.1824 ± 0.0014 | 0.2744 ± 0.0004 | 0.418 ± 0.0012 | 0.3622 ± 0.0008 |
RCGAN | 0.0226 ± 0.0008 | 0.1962 ± 0.0027 | 0.3362 ± 0.0017 | 0.4424 ± 0.0012 | 0.4926 ± 0.0005 |
C-RNN-GAN | 0.2296 ± 0.0040 | 0.3997 ± 0.0028 | 0.4992 ± 0.0008 | 0.4412 ± 0.0014 | 0.4894 ± 0.0005 |
T-forcing | 0.4955 ± 0.0001 | 0.2264 ± 0.0035 | 0.4834 ± 0.0004 | 0.4324 ± 0.0016 | 0.4917 ± 0.0005 |
P-forcing | 0.4308 ± 0.0027 | 0.2575 ± 0.0026 | 0.4125 ± 0.0006 | 0.4465 ± 0.0012 | 0.4725 ± 0.0014 |
WaveNet | 0.1586 ± 0.0011 | 0.2323 ± 0.0028 | 0.3973 ± 0.0010 | 0.4266 ± 0.0012 | 0.4866 ± 0.0006 |
WaveGAN | 0.2774 ± 0.0013 | 0.2175 ± 0.0022 | 0.3634 ± 0.0012 | 0.4534 ± 0.0015 | 0.4816 ± 0.0005 |
\(\lambda \) | 0 | 0.1 | 1 | 10 | 100 |
---|---|---|---|---|---|
MAE | 0.2831 ± 0.0018 | 0.2752 ± 0.0016 | 0.2653 ± 0.0012 | 0.2453 ± 0.0007 | 0.2572 ± 0.0012 |
Attention mechanism | Energy appliances | Power consumption |
---|---|---|
1.5 Entmax | 0.1624 ± 0.0008 | 0.2926 ± 0.0024 |
Softmax | 0.1831 ± 0.0018 | 0.3758 ± 0.0016 |