feat: add mamba and dynamic chunking related code and test code

This commit is contained in:
gameloader
2025-09-04 01:32:13 +00:00
parent 12cb7652cf
commit ef307a57e9
21 changed files with 4550 additions and 86 deletions

View File

@ -0,0 +1,142 @@
export CUDA_VISIBLE_DEVICES=0
model_name=DC_PatchTST
# DC_PatchTST specific parameters
d_model_stage0=64 # Stage 0 dimension (D0)
depth_enc0=1 # Stage 0 Mamba2 encoder depth
depth_enc1=1 # Stage 1 Mamba2 encoder depth
target_ratio0=0.25 # Target compression ratio for stage 0
target_ratio1=0.25 # Target compression ratio for stage 1
# EthanolConcentration dataset
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/EthanolConcentration/ \
--model_id EthanolConcentration \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 8 \
--d_model 128 \
--d_ff 256 \
--n_heads 8 \
--dropout 0.1 \
--activation gelu \
--des 'DC_PatchTST_Exp' \
--itr 1 \
--learning_rate 0.0002 \
--train_epochs 100 \
--patience 10 \
--d_model_stage0 $d_model_stage0 \
--depth_enc0 $depth_enc0 \
--depth_enc1 $depth_enc1 \
--target_ratio0 $target_ratio0 \
--target_ratio1 $target_ratio1
# FaceDetection dataset
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/FaceDetection/ \
--model_id FaceDetection \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 8 \
--d_model 128 \
--d_ff 256 \
--n_heads 8 \
--dropout 0.1 \
--activation gelu \
--des 'DC_PatchTST_Exp' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--d_model_stage0 $d_model_stage0 \
--depth_enc0 $depth_enc0 \
--depth_enc1 $depth_enc1 \
--target_ratio0 $target_ratio0 \
--target_ratio1 $target_ratio1
# Handwriting dataset
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/Handwriting/ \
--model_id Handwriting \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 8 \
--d_model 128 \
--d_ff 256 \
--n_heads 8 \
--dropout 0.1 \
--activation gelu \
--des 'DC_PatchTST_Exp' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--d_model_stage0 $d_model_stage0 \
--depth_enc0 $depth_enc0 \
--depth_enc1 $depth_enc1 \
--target_ratio0 $target_ratio0 \
--target_ratio1 $target_ratio1
# Heartbeat dataset
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/Heartbeat/ \
--model_id Heartbeat \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 8 \
--d_model 128 \
--d_ff 256 \
--n_heads 8 \
--dropout 0.1 \
--activation gelu \
--des 'DC_PatchTST_Exp' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--d_model_stage0 $d_model_stage0 \
--depth_enc0 $depth_enc0 \
--depth_enc1 $depth_enc1 \
--target_ratio0 $target_ratio0 \
--target_ratio1 $target_ratio1
# JapaneseVowels dataset
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/JapaneseVowels/ \
--model_id JapaneseVowels \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 8 \
--d_model 128 \
--d_ff 256 \
--n_heads 8 \
--dropout 0.1 \
--activation gelu \
--des 'DC_PatchTST_Exp' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--d_model_stage0 $d_model_stage0 \
--depth_enc0 $depth_enc0 \
--depth_enc1 $depth_enc1 \
--target_ratio0 $target_ratio0 \
--target_ratio1 $target_ratio1

View File

@ -0,0 +1,259 @@
#!/bin/bash
# vanillaMamba Classification Training Script for Multiple Datasets
export CUDA_VISIBLE_DEVICES=0
model_name=vanillaMamba
# Create results directory if it doesn't exist
mkdir -p ./results
# UWaveGestureLibrary dataset (seq_len=315, enc_in=3) - use Copy1 config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/UWaveGestureLibrary/ \
--model_id UWaveGestureLibrary \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 315 \
--enc_in 3 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 128 \
--dropout 0.1 \
--des 'vanillaMamba_UWaveGestureLibrary' \
--itr 1 \
--learning_rate 0.002 \
--train_epochs 150 \
--patience 30 \
--revin 0 | tee ./results/vanillaMamba_UWaveGestureLibrary.log
# EthanolConcentration dataset (seq_len=1751, enc_in=3) - use Copy1 config
python -u run.py \
--task_name classification \
--is_training 3 \
--root_path ./dataset/EthanolConcentration/ \
--model_id EthanolConcentration \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 1751 \
--enc_in 4 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_EthanolConcentration' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 200 \
--patience 30 \
--revin 0 | tee ./results/vanillaMamba_EthanolConcentration.log
# Handwriting dataset (seq_len=152, enc_in=3) - use Copy1 config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/Handwriting/ \
--model_id Handwriting \
--model $model_name \
--data UEA \
--e_layers 4 \
--batch_size 64 \
--seq_len 152 \
--enc_in 3 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_Handwriting' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 200 \
--patience 30 \
--revin 0 | tee ./results/vanillaMamba_Handwriting.log
# JapaneseVowels dataset (seq_len=29, enc_in=12) - use Copy1 config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/JapaneseVowels/ \
--model_id JapaneseVowels \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 64 \
--seq_len 29 \
--enc_in 12 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_JapaneseVowels' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 30 \
--revin 0 | tee ./results/vanillaMamba_JapaneseVowels.log
# PEMS-SF dataset (seq_len=144, enc_in=963) - use Copy1 config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/PEMS-SF/ \
--model_id PEMS-SF \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 16 \
--seq_len 144 \
--enc_in 963 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_PEMS-SF' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 150 \
--patience 30 \
--revin 0 | tee ./results/vanillaMamba_PEMS-SF.log
# Heartbeat dataset (seq_len=405, enc_in=61) - use original config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/Heartbeat/ \
--model_id Heartbeat \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 64 \
--seq_len 405 \
--enc_in 61 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_Heartbeat' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 150 \
--patience 10 \
--revin 0 | tee ./results/vanillaMamba_Heartbeat.log
# FaceDetection dataset (seq_len=62, enc_in=144) - use original config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/FaceDetection/ \
--model_id FaceDetection \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 64 \
--seq_len 62 \
--enc_in 144 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_FaceDetection' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--revin 0 | tee ./results/vanillaMamba_FaceDetection.log
# SelfRegulationSCP1 dataset (seq_len=896, enc_in=6) - use original config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/SelfRegulationSCP1/ \
--model_id SelfRegulationSCP1 \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 64 \
--seq_len 896 \
--enc_in 6 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_SelfRegulationSCP1' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--revin 0 | tee ./results/vanillaMamba_SelfRegulationSCP1.log
# SelfRegulationSCP2 dataset (seq_len=1152, enc_in=7) - use original config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/SelfRegulationSCP2/ \
--model_id SelfRegulationSCP2 \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 64 \
--seq_len 1152 \
--enc_in 7 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_SelfRegulationSCP2' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--revin 0 | tee ./results/vanillaMamba_SelfRegulationSCP2.log
# SpokenArabicDigits dataset (seq_len=93, enc_in=13) - use original config
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/SpokenArabicDigits/ \
--model_id SpokenArabicDigits \
--model $model_name \
--data UEA \
--e_layers 3 \
--batch_size 64 \
--seq_len 93 \
--enc_in 13 \
--d_model 128 \
--d_state 64 \
--d_conv 4 \
--expand 2 \
--headdim 64 \
--dropout 0.1 \
--des 'vanillaMamba_SpokenArabicDigits' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 10 \
--revin 0 | tee ./results/vanillaMamba_SpokenArabicDigits.log

View File

@ -0,0 +1,145 @@
#!/bin/bash
# xPatch_SparseChannel Classification Training Script for Multiple Datasets
export CUDA_VISIBLE_DEVICES=0
model_name=xPatch_SparseChannel
# Create results directory if it doesn't exist
mkdir -p ./results
# UWaveGestureLibrary dataset (seq_len=315, enc_in=3, k_graph=3)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/UWaveGestureLibrary/ \
--model_id UWaveGestureLibrary \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 315 \
--enc_in 3 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_UWaveGestureLibrary' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 3 | tee ./results/xPatch_SparseChannel_UWaveGestureLibrary.log
# EthanolConcentration dataset (seq_len=1751, enc_in=3, k_graph=3)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/EthanolConcentration/ \
--model_id EthanolConcentration \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 1751 \
--enc_in 3 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_EthanolConcentration' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 3 | tee ./results/xPatch_SparseChannel_EthanolConcentration.log
# Handwriting dataset (seq_len=152, enc_in=3, k_graph=3)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/Handwriting/ \
--model_id Handwriting \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 152 \
--enc_in 3 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_Handwriting' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 3 | tee ./results/xPatch_SparseChannel_Handwriting.log
# JapaneseVowels dataset (seq_len=29, enc_in=12, k_graph=8)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/JapaneseVowels/ \
--model_id JapaneseVowels \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 29 \
--enc_in 12 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_JapaneseVowels' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 8 | tee ./results/xPatch_SparseChannel_JapaneseVowels.log
# PEMS-SF dataset (seq_len=144, enc_in=963, k_graph=8)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/PEMS-SF/ \
--model_id PEMS-SF \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 16 \
--seq_len 144 \
--enc_in 963 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_PEMS-SF' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 8 | tee ./results/xPatch_SparseChannel_PEMS-SF.log

View File

@ -1,10 +1,66 @@
#!/bin/bash
# xPatch_SparseChannel Classification Training Script for FaceDetection Dataset
# xPatch_SparseChannel Classification Training Script for Multiple Datasets
export CUDA_VISIBLE_DEVICES=0
model_name=xPatch_SparseChannel
# Create results directory if it doesn't exist
mkdir -p ./results
# Heartbeat dataset (seq_len=405, enc_in=61, k_graph=8)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/Heartbeat/ \
--model_id Heartbeat \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 405 \
--enc_in 61 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_Heartbeat' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 5 \
--revin 0 \
--k_graph 8 | tee ./results/xPatch_SparseChannel_Heartbeat.log
# UWaveGestureLibrary dataset (seq_len=315, enc_in=3, k_graph=3)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/UWaveGestureLibrary/ \
--model_id UWaveGestureLibrary \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 315 \
--enc_in 3 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_UWaveGestureLibrary' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 3 | tee ./results/xPatch_SparseChannel_UWaveGestureLibrary.log
# FaceDetection dataset (seq_len=62, enc_in=144, k_graph=8)
python -u run.py \
--task_name classification \
--is_training 1 \
@ -12,21 +68,202 @@ python -u run.py \
--model_id FaceDetection \
--model $model_name \
--data UEA \
--e_layers 3 \
--e_layers 2 \
--batch_size 64 \
--seq_len 62 \
--enc_in 144 \
--d_model 128 \
--d_ff 256 \
--n_heads 8 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--moving_avg 25 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_FaceDetection' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 5 \
--revin 1 \
--k_graph 8
--revin 0 \
--k_graph 8 | tee ./results/xPatch_SparseChannel_FaceDetection.log
# EthanolConcentration dataset (seq_len=1751, enc_in=3, k_graph=3)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/EthanolConcentration/ \
--model_id EthanolConcentration \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 1751 \
--enc_in 3 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_EthanolConcentration' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 3 | tee ./results/xPatch_SparseChannel_EthanolConcentration.log
# Handwriting dataset (seq_len=152, enc_in=3, k_graph=3)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/Handwriting/ \
--model_id Handwriting \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 152 \
--enc_in 3 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_Handwriting' \
--itr 1 \
--learning_rate 0.001 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 3 | tee ./results/xPatch_SparseChannel_Handwriting.log
# JapaneseVowels dataset (seq_len=29, enc_in=12, k_graph=8)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/JapaneseVowels/ \
--model_id JapaneseVowels \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 29 \
--enc_in 12 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_JapaneseVowels' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 8 | tee ./results/xPatch_SparseChannel_JapaneseVowels.log
# SelfRegulationSCP1 dataset (seq_len=896, enc_in=6, k_graph=6)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/SelfRegulationSCP1/ \
--model_id SelfRegulationSCP1 \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 896 \
--enc_in 6 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_SelfRegulationSCP1' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 5 \
--revin 0 \
--k_graph 6 | tee ./results/xPatch_SparseChannel_SelfRegulationSCP1.log
# SelfRegulationSCP2 dataset (seq_len=1152, enc_in=7, k_graph=7)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/SelfRegulationSCP2/ \
--model_id SelfRegulationSCP2 \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 1152 \
--enc_in 7 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_SelfRegulationSCP2' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 5 \
--revin 0 \
--k_graph 7 | tee ./results/xPatch_SparseChannel_SelfRegulationSCP2.log
# SpokenArabicDigits dataset (seq_len=93, enc_in=13, k_graph=8)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/SpokenArabicDigits/ \
--model_id SpokenArabicDigits \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 64 \
--seq_len 93 \
--enc_in 13 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_SpokenArabicDigits' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 5 \
--revin 0 \
--k_graph 8 | tee ./results/xPatch_SparseChannel_SpokenArabicDigits.log
# PEMS-SF dataset (seq_len=144, enc_in=963, k_graph=8)
python -u run.py \
--task_name classification \
--is_training 1 \
--root_path ./dataset/PEMS-SF/ \
--model_id PEMS-SF \
--model $model_name \
--data UEA \
--e_layers 2 \
--batch_size 16 \
--seq_len 144 \
--enc_in 963 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--dropout 0.1 \
--des 'xPatch_SparseChannel_PEMS-SF' \
--itr 1 \
--learning_rate 0.0005 \
--train_epochs 100 \
--patience 30 \
--revin 0 \
--k_graph 8 | tee ./results/xPatch_SparseChannel_PEMS-SF.log

View File

@ -0,0 +1,251 @@
#!/bin/bash
model_name=vanillaMamba
# ETTm1 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTm1.csv \
--model_id ETTm1_$pred_len'_'$pred_len \
--model $model_name \
--data ETTm1 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done
# ETTm2 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTm2.csv \
--model_id ETTm2_$pred_len'_'$pred_len \
--model $model_name \
--data ETTm2 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done
# ETTh1 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTh1.csv \
--model_id ETTh1_$pred_len'_'$pred_len \
--model $model_name \
--data ETTh1 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done
# ETTh2 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTh2.csv \
--model_id ETTh2_$pred_len'_'$pred_len \
--model $model_name \
--data ETTh2 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done
# Weather dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/weather/ \
--data_path weather.csv \
--model_id weather_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 21 \
--c_out 21 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done
# ECL dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/electricity/ \
--data_path electricity.csv \
--model_id ECL_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 321 \
--c_out 321 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done
# Traffic dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/traffic/ \
--data_path traffic.csv \
--model_id traffic_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 862 \
--c_out 862 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done
# Exchange dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/exchange_rate/ \
--data_path exchange_rate.csv \
--model_id Exchange_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 8 \
--c_out 8 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1
done

View File

@ -0,0 +1,150 @@
#!/bin/bash
#export CUDA_VISIBLE_DEVICES=0
model_name=xPatch_SparseChannel
seq_len=96
pred_len=12
learning_rate=0.003
d_model=128
d_ff=256
batch_size=128
train_epochs=10
patience=10
# PEMS03 dataset
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/PEMS/ \
--data_path PEMS03.npz \
--model_id PEMS03 \
--model $model_name \
--data PEMS \
--features M \
--seq_len $seq_len \
--label_len 0 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 358 \
--dec_in 358 \
--c_out 358 \
--lradj 'sigmoid' \
--d_model $d_model \
--d_ff $d_ff \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--batch_size $batch_size \
--learning_rate $learning_rate \
--train_epochs $train_epochs \
--patience $patience \
--des 'Exp' \
--itr 1
# PEMS04 dataset
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/PEMS/ \
--data_path PEMS04.npz \
--model_id PEMS04 \
--model $model_name \
--data PEMS \
--features M \
--seq_len $seq_len \
--label_len 0 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 307 \
--dec_in 307 \
--c_out 307 \
--lradj 'sigmoid' \
--d_model $d_model \
--d_ff $d_ff \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--batch_size $batch_size \
--learning_rate $learning_rate \
--train_epochs $train_epochs \
--patience $patience \
--des 'Exp' \
--itr 1
# PEMS07 dataset
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/PEMS/ \
--data_path PEMS07.npz \
--model_id PEMS07 \
--model $model_name \
--data PEMS \
--features M \
--seq_len $seq_len \
--label_len 0 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 883 \
--dec_in 883 \
--c_out 883 \
--lradj 'sigmoid' \
--d_model $d_model \
--d_ff $d_ff \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--batch_size $batch_size \
--learning_rate $learning_rate \
--train_epochs $train_epochs \
--patience $patience \
--des 'Exp' \
--itr 1
# PEMS08 dataset
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/PEMS/ \
--data_path PEMS08.npz \
--model_id PEMS08 \
--model $model_name \
--data PEMS \
--features M \
--seq_len $seq_len \
--label_len 0 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 170 \
--dec_in 170 \
--c_out 170 \
--lradj 'sigmoid' \
--d_model $d_model \
--d_ff $d_ff \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--batch_size $batch_size \
--learning_rate $learning_rate \
--train_epochs $train_epochs \
--patience $patience \
--des 'Exp' \
--itr 1

View File

@ -0,0 +1,251 @@
#!/bin/bash
model_name=xPatch_SparseChannel
# ETTm1 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTm1.csv \
--model_id ETTm1_$pred_len'_'$pred_len \
--model $model_name \
--data ETTm1 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 7 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# ETTm2 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTm2.csv \
--model_id ETTm2_$pred_len'_'$pred_len \
--model $model_name \
--data ETTm2 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 7 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# ETTh1 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTh1.csv \
--model_id ETTh1_$pred_len'_'$pred_len \
--model $model_name \
--data ETTh1 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 7 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# ETTh2 dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/ETT-small/ \
--data_path ETTh2.csv \
--model_id ETTh2_$pred_len'_'$pred_len \
--model $model_name \
--data ETTh2 \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 7 \
--c_out 7 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 7 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# Weather dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/weather/ \
--data_path weather.csv \
--model_id weather_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 21 \
--c_out 21 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# ECL dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/electricity/ \
--data_path electricity.csv \
--model_id ECL_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 321 \
--c_out 321 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# Traffic dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/traffic/ \
--data_path traffic.csv \
--model_id traffic_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 862 \
--c_out 862 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# Exchange dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/exchange_rate/ \
--data_path exchange_rate.csv \
--model_id Exchange_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 8 \
--c_out 8 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done

View File

@ -0,0 +1,77 @@
#!/bin/bash
model_name=xPatch_SparseChannel
# ECL dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/electricity/ \
--data_path electricity.csv \
--model_id ECL_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 321 \
--batch_size 512 \
--learning_rate 0.001 \
--use_multi_gpu True \
--lradj 'sigmoid' \
--train_epochs 50 \
--patience 5 \
--c_out 321 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done
# Traffic dataset
for pred_len in 96 192 336 720
do
python -u run.py \
--task_name long_term_forecast \
--is_training 1 \
--root_path ./dataset/traffic/ \
--data_path traffic.csv \
--model_id traffic_$pred_len'_'$pred_len \
--model $model_name \
--data custom \
--features M \
--seq_len 96 \
--label_len 48 \
--pred_len $pred_len \
--e_layers 2 \
--d_layers 1 \
--enc_in 862 \
--batch_size 256 \
--learning_rate 0.0005 \
--use_multi_gpu True \
--lradj 'sigmoid' \
--train_epochs 50 \
--patience 5 \
--c_out 862 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 8 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1
done

View File

@ -0,0 +1,165 @@
#!/bin/bash
model_name=vanillaMamba
# M4 Monthly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Monthly' \
--model_id m4_Monthly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Yearly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Yearly' \
--model_id m4_Yearly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Quarterly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Quarterly' \
--model_id m4_Quarterly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Weekly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Weekly' \
--model_id m4_Weekly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Daily
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Daily' \
--model_id m4_Daily \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Hourly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Hourly' \
--model_id m4_Hourly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--expand 2 \
--d_conv 4 \
--d_state 64 \
--headdim 64 \
--ngroups 1 \
--chunk_size 256 \
--dropout 0.1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'

View File

@ -0,0 +1,165 @@
#!/bin/bash
model_name=xPatch_SparseChannel
# M4 Monthly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Monthly' \
--model_id m4_Monthly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 1 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Yearly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Yearly' \
--model_id m4_Yearly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 1 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Quarterly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Quarterly' \
--model_id m4_Quarterly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 1 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Weekly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Weekly' \
--model_id m4_Weekly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 1 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Daily
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Daily' \
--model_id m4_Daily \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 1 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'
# M4 Hourly
python -u run.py \
--task_name short_term_forecast \
--is_training 1 \
--root_path ./dataset/m4 \
--seasonal_patterns 'Hourly' \
--model_id m4_Hourly \
--model $model_name \
--data m4 \
--features M \
--e_layers 2 \
--enc_in 1 \
--c_out 1 \
--batch_size 16 \
--d_model 128 \
--d_ff 256 \
--n_heads 16 \
--patch_len 16 \
--stride 8 \
--k_graph 1 \
--dropout 0.1 \
--revin 1 \
--des 'Exp' \
--itr 1 \
--learning_rate 0.001 \
--loss 'SMAPE'