Upload 7 files
Browse files- checkpoints +20 -0
- data_provider +8 -0
- layers +16 -0
- models +31 -0
- requirements.txt +13 -0
- run.py +227 -0
- utils +12 -0
checkpoints
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>start("/Users/inertia/Desktop/tide_prediction_project/TimeXer-main/checkpoints/");</script>
|
| 2 |
+
<script>onHasParentDirectory();</script>
|
| 3 |
+
<script>addRow("long_term_forecast_DT_0001_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0001_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 4 |
+
<script>addRow("long_term_forecast_DT_0002_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0002_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 5 |
+
<script>addRow("long_term_forecast_DT_0003_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0003_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 6 |
+
<script>addRow("long_term_forecast_DT_0008_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0008_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 7 |
+
<script>addRow("long_term_forecast_DT_0017_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0017_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 8 |
+
<script>addRow("long_term_forecast_DT_0018_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0018_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 9 |
+
<script>addRow("long_term_forecast_DT_0024_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0024_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 10 |
+
<script>addRow("long_term_forecast_DT_0025_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0025_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 11 |
+
<script>addRow("long_term_forecast_DT_0037_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0037_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 12 |
+
<script>addRow("long_term_forecast_DT_0043_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0043_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 13 |
+
<script>addRow("long_term_forecast_DT_0050_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0050_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 14 |
+
<script>addRow("long_term_forecast_DT_0051_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0051_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 15 |
+
<script>addRow("long_term_forecast_DT_0052_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0052_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 16 |
+
<script>addRow("long_term_forecast_DT_0065_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0065_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 17 |
+
<script>addRow("long_term_forecast_DT_0066_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0066_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 18 |
+
<script>addRow("long_term_forecast_DT_0067_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0067_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 19 |
+
<script>addRow("long_term_forecast_DT_0068_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0","long_term_forecast_DT_0068_144_72_TimeXer_TIDE_ftMS_sl144_ll96_pl72_dm256_nh8_el1_dl1_df512_expand2_dc4_fc3_ebtimeF_dtTrue_Exp_0",1,128,"128 B",1753578822,"7/27/25, 10:13:42 AM");</script>
|
| 20 |
+
<script>addRow(".DS_Store",".DS_Store",0,6148,"6.0 kB",1753578849,"7/27/25, 10:14:09 AM");</script>
|
data_provider
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>start("/Users/inertia/Desktop/tide_prediction_project/TimeXer-main/data_provider/");</script>
|
| 2 |
+
<script>onHasParentDirectory();</script>
|
| 3 |
+
<script>addRow("__pycache__","__pycache__",1,224,"224 B",1752058048,"7/9/25, 7:47:28 PM");</script>
|
| 4 |
+
<script>addRow("__init__.py","__init__.py",0,1,"1 B",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 5 |
+
<script>addRow("data_factory.py","data_factory.py",0,1953,"1.9 kB",1753163478,"7/22/25, 2:51:18 PM");</script>
|
| 6 |
+
<script>addRow("data_loader.py","data_loader.py",0,43957,"42.9 kB",1753164809,"7/22/25, 3:13:29 PM");</script>
|
| 7 |
+
<script>addRow("m4.py","m4.py",0,4451,"4.3 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 8 |
+
<script>addRow("uea.py","uea.py",0,5036,"4.9 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
layers
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>start("/Users/inertia/Desktop/tide_prediction_project/TimeXer-main/layers/");</script>
|
| 2 |
+
<script>onHasParentDirectory();</script>
|
| 3 |
+
<script>addRow("__pycache__","__pycache__",1,480,"480 B",1752058061,"7/9/25, 7:47:41 PM");</script>
|
| 4 |
+
<script>addRow("__init__.py","__init__.py",0,0,"0 B",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 5 |
+
<script>addRow("AutoCorrelation.py","AutoCorrelation.py",0,6440,"6.3 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 6 |
+
<script>addRow("Autoformer_EncDec.py","Autoformer_EncDec.py",0,6831,"6.7 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 7 |
+
<script>addRow("Conv_Blocks.py","Conv_Blocks.py",0,2376,"2.3 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 8 |
+
<script>addRow("Crossformer_EncDec.py","Crossformer_EncDec.py",0,4333,"4.2 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 9 |
+
<script>addRow("Embed.py","Embed.py",0,7025,"6.9 kB",1752042645,"7/9/25, 3:30:45 PM");</script>
|
| 10 |
+
<script>addRow("ETSformer_EncDec.py","ETSformer_EncDec.py",0,11433,"11.2 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 11 |
+
<script>addRow("FourierCorrelation.py","FourierCorrelation.py",0,7346,"7.2 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 12 |
+
<script>addRow("MultiWaveletCorrelation.py","MultiWaveletCorrelation.py",0,23039,"22.5 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 13 |
+
<script>addRow("Pyraformer_EncDec.py","Pyraformer_EncDec.py",0,7433,"7.3 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 14 |
+
<script>addRow("SelfAttention_Family.py","SelfAttention_Family.py",0,12001,"11.7 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 15 |
+
<script>addRow("StandardNorm.py","StandardNorm.py",0,2184,"2.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 16 |
+
<script>addRow("Transformer_EncDec.py","Transformer_EncDec.py",0,4929,"4.8 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
models
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>start("/Users/inertia/Desktop/tide_prediction_project/TimeXer-main/models/");</script>
|
| 2 |
+
<script>onHasParentDirectory();</script>
|
| 3 |
+
<script>addRow("__pycache__","__pycache__",1,928,"928 B",1752058061,"7/9/25, 7:47:41 PM");</script>
|
| 4 |
+
<script>addRow("__init__.py","__init__.py",0,0,"0 B",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 5 |
+
<script>addRow("Autoformer.py","Autoformer.py",0,6815,"6.7 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 6 |
+
<script>addRow("Crossformer.py","Crossformer.py",0,6363,"6.2 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 7 |
+
<script>addRow("DLinear.py","DLinear.py",0,4501,"4.4 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 8 |
+
<script>addRow("ETSformer.py","ETSformer.py",0,4599,"4.5 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 9 |
+
<script>addRow("FEDformer.py","FEDformer.py",0,8449,"8.3 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 10 |
+
<script>addRow("FiLM.py","FiLM.py",0,11567,"11.3 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 11 |
+
<script>addRow("FreTS.py","FreTS.py",0,4630,"4.5 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 12 |
+
<script>addRow("Informer.py","Informer.py",0,6395,"6.2 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 13 |
+
<script>addRow("iTransformer.py","iTransformer.py",0,5735,"5.6 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 14 |
+
<script>addRow("Koopa.py","Koopa.py",0,13374,"13.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 15 |
+
<script>addRow("LightTS.py","LightTS.py",0,5671,"5.5 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 16 |
+
<script>addRow("Mamba.py","Mamba.py",0,1590,"1.6 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 17 |
+
<script>addRow("MambaSimple.py","MambaSimple.py",0,5493,"5.4 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 18 |
+
<script>addRow("MICN.py","MICN.py",0,9901,"9.7 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 19 |
+
<script>addRow("Nonstationary_Transformer.py","Nonstationary_Transformer.py",0,9719,"9.5 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 20 |
+
<script>addRow("PatchTST.py","PatchTST.py",0,9071,"8.9 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 21 |
+
<script>addRow("Pyraformer.py","Pyraformer.py",0,4215,"4.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 22 |
+
<script>addRow("Reformer.py","Reformer.py",0,5090,"5.0 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 23 |
+
<script>addRow("SCINet.py","SCINet.py",0,7357,"7.2 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 24 |
+
<script>addRow("SegRNN.py","SegRNN.py",0,4215,"4.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 25 |
+
<script>addRow("TemporalFusionTransformer.py","TemporalFusionTransformer.py",0,14027,"13.7 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 26 |
+
<script>addRow("TiDE.py","TiDE.py",0,7222,"7.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 27 |
+
<script>addRow("TimeMixer.py","TimeMixer.py",0,20024,"19.6 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 28 |
+
<script>addRow("TimesNet.py","TimesNet.py",0,8684,"8.5 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 29 |
+
<script>addRow("TimeXer.py","TimeXer.py",0,9259,"9.0 kB",1752469382,"7/14/25, 2:03:02 PM");</script>
|
| 30 |
+
<script>addRow("Transformer.py","Transformer.py",0,5561,"5.4 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 31 |
+
<script>addRow("TSMixer.py","TSMixer.py",0,1814,"1.8 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
requirements.txt
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
einops
|
| 2 |
+
joblib
|
| 3 |
+
matplotlib==3.7.0
|
| 4 |
+
numpy==1.23.5
|
| 5 |
+
pandas==1.5.3
|
| 6 |
+
patool==1.12
|
| 7 |
+
reformer-pytorch==1.4.4
|
| 8 |
+
scikit-learn==1.2.2
|
| 9 |
+
scipy==1.10.1
|
| 10 |
+
sktime==0.16.1
|
| 11 |
+
sympy==1.11.1
|
| 12 |
+
torch==2.0.0
|
| 13 |
+
tqdm==4.64.1
|
run.py
ADDED
|
@@ -0,0 +1,227 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import argparse
|
| 2 |
+
import os
|
| 3 |
+
import torch
|
| 4 |
+
from exp.exp_long_term_forecasting import Exp_Long_Term_Forecast
|
| 5 |
+
from exp.exp_imputation import Exp_Imputation
|
| 6 |
+
from exp.exp_short_term_forecasting import Exp_Short_Term_Forecast
|
| 7 |
+
from exp.exp_anomaly_detection import Exp_Anomaly_Detection
|
| 8 |
+
from exp.exp_classification import Exp_Classification
|
| 9 |
+
from utils.print_args import print_args
|
| 10 |
+
import random
|
| 11 |
+
import numpy as np
|
| 12 |
+
|
| 13 |
+
if __name__ == '__main__':
|
| 14 |
+
fix_seed = 2021
|
| 15 |
+
random.seed(fix_seed)
|
| 16 |
+
torch.manual_seed(fix_seed)
|
| 17 |
+
np.random.seed(fix_seed)
|
| 18 |
+
|
| 19 |
+
parser = argparse.ArgumentParser(description='TimesNet')
|
| 20 |
+
|
| 21 |
+
# basic config
|
| 22 |
+
parser.add_argument('--task_name', type=str, required=True, default='long_term_forecast',
|
| 23 |
+
help='task name, options:[long_term_forecast, short_term_forecast, imputation, classification, anomaly_detection]')
|
| 24 |
+
parser.add_argument('--is_training', type=int, required=True, default=1, help='status')
|
| 25 |
+
parser.add_argument('--model_id', type=str, required=True, default='test', help='model id')
|
| 26 |
+
parser.add_argument('--model', type=str, required=True, default='Autoformer',
|
| 27 |
+
help='model name, options: [Autoformer, Transformer, TimesNet]')
|
| 28 |
+
|
| 29 |
+
# data loader
|
| 30 |
+
parser.add_argument('--data', type=str, required=True, default='ETTm1', help='dataset type')
|
| 31 |
+
parser.add_argument('--root_path', type=str, default='./data/ETT/', help='root path of the data file')
|
| 32 |
+
parser.add_argument('--data_path', type=str, default='ETTh1.csv', help='data file')
|
| 33 |
+
parser.add_argument('--features', type=str, default='M',
|
| 34 |
+
help='forecasting task, options:[M, S, MS]; M:multivariate predict multivariate, S:univariate predict univariate, MS:multivariate predict univariate')
|
| 35 |
+
parser.add_argument('--target', type=str, default='residual', help='target feature in S or MS task')
|
| 36 |
+
parser.add_argument('--freq', type=str, default='t',
|
| 37 |
+
help='freq for time features encoding, options:[s:secondly, t:minutely, h:hourly, d:daily, b:business days, w:weekly, m:monthly], you can also use more detailed freq like 15min or 3h')
|
| 38 |
+
parser.add_argument('--checkpoints', type=str, default='./checkpoints/', help='location of model checkpoints')
|
| 39 |
+
|
| 40 |
+
# forecasting task
|
| 41 |
+
parser.add_argument('--seq_len', type=int, default=96, help='input sequence length')
|
| 42 |
+
parser.add_argument('--label_len', type=int, default=48, help='start token length')
|
| 43 |
+
parser.add_argument('--pred_len', type=int, default=96, help='prediction sequence length')
|
| 44 |
+
parser.add_argument('--seasonal_patterns', type=str, default='Monthly', help='subset for M4')
|
| 45 |
+
parser.add_argument('--inverse', action='store_true', help='inverse output data', default=True)
|
| 46 |
+
|
| 47 |
+
# inputation task
|
| 48 |
+
parser.add_argument('--mask_rate', type=float, default=0.25, help='mask ratio')
|
| 49 |
+
|
| 50 |
+
# anomaly detection task
|
| 51 |
+
parser.add_argument('--anomaly_ratio', type=float, default=0.25, help='prior anomaly ratio (%)')
|
| 52 |
+
|
| 53 |
+
# model define
|
| 54 |
+
parser.add_argument('--expand', type=int, default=2, help='expansion factor for Mamba')
|
| 55 |
+
parser.add_argument('--d_conv', type=int, default=4, help='conv kernel size for Mamba')
|
| 56 |
+
parser.add_argument('--top_k', type=int, default=5, help='for TimesBlock')
|
| 57 |
+
parser.add_argument('--num_kernels', type=int, default=6, help='for Inception')
|
| 58 |
+
parser.add_argument('--enc_in', type=int, default=7, help='encoder input size')
|
| 59 |
+
parser.add_argument('--dec_in', type=int, default=7, help='decoder input size')
|
| 60 |
+
parser.add_argument('--c_out', type=int, default=7, help='output size')
|
| 61 |
+
parser.add_argument('--d_model', type=int, default=512, help='dimension of model')
|
| 62 |
+
parser.add_argument('--n_heads', type=int, default=8, help='num of heads')
|
| 63 |
+
parser.add_argument('--e_layers', type=int, default=2, help='num of encoder layers')
|
| 64 |
+
parser.add_argument('--d_layers', type=int, default=1, help='num of decoder layers')
|
| 65 |
+
parser.add_argument('--d_ff', type=int, default=2048, help='dimension of fcn')
|
| 66 |
+
parser.add_argument('--moving_avg', type=int, default=25, help='window size of moving average')
|
| 67 |
+
parser.add_argument('--factor', type=int, default=1, help='attn factor')
|
| 68 |
+
parser.add_argument('--distil', action='store_false',
|
| 69 |
+
help='whether to use distilling in encoder, using this argument means not using distilling',
|
| 70 |
+
default=True)
|
| 71 |
+
parser.add_argument('--dropout', type=float, default=0.1, help='dropout')
|
| 72 |
+
parser.add_argument('--embed', type=str, default='timeF',
|
| 73 |
+
help='time features encoding, options:[timeF, fixed, learned]')
|
| 74 |
+
parser.add_argument('--activation', type=str, default='gelu', help='activation')
|
| 75 |
+
parser.add_argument('--output_attention', action='store_true', help='whether to output attention in ecoder')
|
| 76 |
+
parser.add_argument('--channel_independence', type=int, default=1,
|
| 77 |
+
help='0: channel dependence 1: channel independence for FreTS model')
|
| 78 |
+
parser.add_argument('--decomp_method', type=str, default='moving_avg',
|
| 79 |
+
help='method of series decompsition, only support moving_avg or dft_decomp')
|
| 80 |
+
parser.add_argument('--use_norm', type=int, default=1, help='whether to use normalize; True 1 False 0')
|
| 81 |
+
parser.add_argument('--down_sampling_layers', type=int, default=0, help='num of down sampling layers')
|
| 82 |
+
parser.add_argument('--down_sampling_window', type=int, default=1, help='down sampling window size')
|
| 83 |
+
parser.add_argument('--down_sampling_method', type=str, default=None,
|
| 84 |
+
help='down sampling method, only support avg, max, conv')
|
| 85 |
+
parser.add_argument('--seg_len', type=int, default=48,
|
| 86 |
+
help='the length of segmen-wise iteration of SegRNN')
|
| 87 |
+
|
| 88 |
+
# optimization
|
| 89 |
+
parser.add_argument('--num_workers', type=int, default=10, help='data loader num workers')
|
| 90 |
+
parser.add_argument('--itr', type=int, default=1, help='experiments times')
|
| 91 |
+
parser.add_argument('--train_epochs', type=int, default=20, help='train epochs')
|
| 92 |
+
parser.add_argument('--batch_size', type=int, default=32, help='batch size of train input data')
|
| 93 |
+
parser.add_argument('--patience', type=int, default=3, help='early stopping patience')
|
| 94 |
+
parser.add_argument('--learning_rate', type=float, default=0.0001, help='optimizer learning rate')
|
| 95 |
+
parser.add_argument('--des', type=str, default='test', help='exp description')
|
| 96 |
+
parser.add_argument('--loss', type=str, default='MSE', help='loss function')
|
| 97 |
+
parser.add_argument('--lradj', type=str, default='type1', help='adjust learning rate')
|
| 98 |
+
parser.add_argument('--use_amp', action='store_true', help='use automatic mixed precision training', default=False)
|
| 99 |
+
|
| 100 |
+
# GPU
|
| 101 |
+
parser.add_argument('--use_gpu', type=bool, default=True, help='use gpu')
|
| 102 |
+
parser.add_argument('--gpu', type=int, default=0, help='gpu')
|
| 103 |
+
parser.add_argument('--use_multi_gpu', action='store_true', help='use multiple gpus', default=False)
|
| 104 |
+
parser.add_argument('--devices', type=str, default='0,1,2,3', help='device ids of multile gpus')
|
| 105 |
+
|
| 106 |
+
# de-stationary projector params
|
| 107 |
+
parser.add_argument('--p_hidden_dims', type=int, nargs='+', default=[128, 128],
|
| 108 |
+
help='hidden layer dimensions of projector (List)')
|
| 109 |
+
parser.add_argument('--p_hidden_layers', type=int, default=2, help='number of hidden layers in projector')
|
| 110 |
+
|
| 111 |
+
# metrics (dtw)
|
| 112 |
+
parser.add_argument('--use_dtw', type=bool, default=False,
|
| 113 |
+
help='the controller of using dtw metric (dtw is time consuming, not suggested unless necessary)')
|
| 114 |
+
|
| 115 |
+
# Augmentation
|
| 116 |
+
parser.add_argument('--augmentation_ratio', type=int, default=0, help="How many times to augment")
|
| 117 |
+
parser.add_argument('--seed', type=int, default=2, help="Randomization seed")
|
| 118 |
+
parser.add_argument('--jitter', default=False, action="store_true", help="Jitter preset augmentation")
|
| 119 |
+
parser.add_argument('--scaling', default=False, action="store_true", help="Scaling preset augmentation")
|
| 120 |
+
parser.add_argument('--permutation', default=False, action="store_true",
|
| 121 |
+
help="Equal Length Permutation preset augmentation")
|
| 122 |
+
parser.add_argument('--randompermutation', default=False, action="store_true",
|
| 123 |
+
help="Random Length Permutation preset augmentation")
|
| 124 |
+
parser.add_argument('--magwarp', default=False, action="store_true", help="Magnitude warp preset augmentation")
|
| 125 |
+
parser.add_argument('--timewarp', default=False, action="store_true", help="Time warp preset augmentation")
|
| 126 |
+
parser.add_argument('--windowslice', default=False, action="store_true", help="Window slice preset augmentation")
|
| 127 |
+
parser.add_argument('--windowwarp', default=False, action="store_true", help="Window warp preset augmentation")
|
| 128 |
+
parser.add_argument('--rotation', default=False, action="store_true", help="Rotation preset augmentation")
|
| 129 |
+
parser.add_argument('--spawner', default=False, action="store_true", help="SPAWNER preset augmentation")
|
| 130 |
+
parser.add_argument('--dtwwarp', default=False, action="store_true", help="DTW warp preset augmentation")
|
| 131 |
+
parser.add_argument('--shapedtwwarp', default=False, action="store_true", help="Shape DTW warp preset augmentation")
|
| 132 |
+
parser.add_argument('--wdba', default=False, action="store_true", help="Weighted DBA preset augmentation")
|
| 133 |
+
parser.add_argument('--discdtw', default=False, action="store_true",
|
| 134 |
+
help="Discrimitive DTW warp preset augmentation")
|
| 135 |
+
parser.add_argument('--discsdtw', default=False, action="store_true",
|
| 136 |
+
help="Discrimitive shapeDTW warp preset augmentation")
|
| 137 |
+
parser.add_argument('--extra_tag', type=str, default="", help="Anything extra")
|
| 138 |
+
|
| 139 |
+
# TimeXer
|
| 140 |
+
parser.add_argument('--patch_len', type=int, default=16, help='patch length')
|
| 141 |
+
|
| 142 |
+
args = parser.parse_args()
|
| 143 |
+
# args.use_gpu = True if torch.cuda.is_available() and args.use_gpu else False
|
| 144 |
+
args.use_gpu = True if torch.cuda.is_available() else False
|
| 145 |
+
|
| 146 |
+
print(torch.cuda.is_available())
|
| 147 |
+
|
| 148 |
+
if args.use_gpu and args.use_multi_gpu:
|
| 149 |
+
args.devices = args.devices.replace(' ', '')
|
| 150 |
+
device_ids = args.devices.split(',')
|
| 151 |
+
args.device_ids = [int(id_) for id_ in device_ids]
|
| 152 |
+
args.gpu = args.device_ids[0]
|
| 153 |
+
|
| 154 |
+
print('Args in experiment:')
|
| 155 |
+
print_args(args)
|
| 156 |
+
|
| 157 |
+
if args.task_name == 'long_term_forecast':
|
| 158 |
+
Exp = Exp_Long_Term_Forecast
|
| 159 |
+
elif args.task_name == 'short_term_forecast':
|
| 160 |
+
Exp = Exp_Short_Term_Forecast
|
| 161 |
+
elif args.task_name == 'imputation':
|
| 162 |
+
Exp = Exp_Imputation
|
| 163 |
+
elif args.task_name == 'anomaly_detection':
|
| 164 |
+
Exp = Exp_Anomaly_Detection
|
| 165 |
+
elif args.task_name == 'classification':
|
| 166 |
+
Exp = Exp_Classification
|
| 167 |
+
else:
|
| 168 |
+
Exp = Exp_Long_Term_Forecast
|
| 169 |
+
|
| 170 |
+
if args.is_training:
|
| 171 |
+
for ii in range(args.itr):
|
| 172 |
+
# setting record of experiments
|
| 173 |
+
exp = Exp(args) # set experiments
|
| 174 |
+
setting = '{}_{}_{}_{}_ft{}_sl{}_ll{}_pl{}_dm{}_nh{}_el{}_dl{}_df{}_expand{}_dc{}_fc{}_eb{}_dt{}_{}_{}'.format(
|
| 175 |
+
args.task_name,
|
| 176 |
+
args.model_id,
|
| 177 |
+
args.model,
|
| 178 |
+
args.data,
|
| 179 |
+
args.features,
|
| 180 |
+
args.seq_len,
|
| 181 |
+
args.label_len,
|
| 182 |
+
args.pred_len,
|
| 183 |
+
args.d_model,
|
| 184 |
+
args.n_heads,
|
| 185 |
+
args.e_layers,
|
| 186 |
+
args.d_layers,
|
| 187 |
+
args.d_ff,
|
| 188 |
+
args.expand,
|
| 189 |
+
args.d_conv,
|
| 190 |
+
args.factor,
|
| 191 |
+
args.embed,
|
| 192 |
+
args.distil,
|
| 193 |
+
args.des, ii)
|
| 194 |
+
|
| 195 |
+
print('>>>>>>>start training : {}>>>>>>>>>>>>>>>>>>>>>>>>>>'.format(setting))
|
| 196 |
+
exp.train(setting)
|
| 197 |
+
|
| 198 |
+
print('>>>>>>>testing : {}<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<'.format(setting))
|
| 199 |
+
exp.test(setting)
|
| 200 |
+
torch.cuda.empty_cache()
|
| 201 |
+
else:
|
| 202 |
+
ii = 0
|
| 203 |
+
setting = '{}_{}_{}_{}_ft{}_sl{}_ll{}_pl{}_dm{}_nh{}_el{}_dl{}_df{}_expand{}_dc{}_fc{}_eb{}_dt{}_{}_{}'.format(
|
| 204 |
+
args.task_name,
|
| 205 |
+
args.model_id,
|
| 206 |
+
args.model,
|
| 207 |
+
args.data,
|
| 208 |
+
args.features,
|
| 209 |
+
args.seq_len,
|
| 210 |
+
args.label_len,
|
| 211 |
+
args.pred_len,
|
| 212 |
+
args.d_model,
|
| 213 |
+
args.n_heads,
|
| 214 |
+
args.e_layers,
|
| 215 |
+
args.d_layers,
|
| 216 |
+
args.d_ff,
|
| 217 |
+
args.expand,
|
| 218 |
+
args.d_conv,
|
| 219 |
+
args.factor,
|
| 220 |
+
args.embed,
|
| 221 |
+
args.distil,
|
| 222 |
+
args.des, ii)
|
| 223 |
+
|
| 224 |
+
exp = Exp(args) # set experiments
|
| 225 |
+
print('>>>>>>>testing : {}<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<'.format(setting))
|
| 226 |
+
exp.test(setting, test=1)
|
| 227 |
+
torch.cuda.empty_cache()
|
utils
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<script>start("/Users/inertia/Desktop/tide_prediction_project/TimeXer-main/utils/");</script>
|
| 2 |
+
<script>onHasParentDirectory();</script>
|
| 3 |
+
<script>addRow("__pycache__","__pycache__",1,352,"352 B",1752058061,"7/9/25, 7:47:41 PM");</script>
|
| 4 |
+
<script>addRow("__init__.py","__init__.py",0,0,"0 B",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 5 |
+
<script>addRow("augmentation.py","augmentation.py",0,20122,"19.7 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 6 |
+
<script>addRow("losses.py","losses.py",0,3459,"3.4 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 7 |
+
<script>addRow("m4_summary.py","m4_summary.py",0,6174,"6.0 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 8 |
+
<script>addRow("masking.py","masking.py",0,11384,"11.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 9 |
+
<script>addRow("metrics.py","metrics.py",0,930,"930 B",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 10 |
+
<script>addRow("print_args.py","print_args.py",0,3139,"3.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 11 |
+
<script>addRow("timefeatures.py","timefeatures.py",0,4369,"4.3 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|
| 12 |
+
<script>addRow("tools.py","tools.py",0,6236,"6.1 kB",1732692345,"11/27/24, 4:25:45 PM");</script>
|