-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d177d04
commit 1d7aa54
Showing
62 changed files
with
1,536 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[data] | ||
num_nodes = 211 | ||
lag = 12 | ||
horizon = 12 | ||
val_ratio = 0.1 | ||
test_ratio = 0.2 | ||
tod = False | ||
normalizer = std | ||
column_wise = False | ||
default_graph = True | ||
|
||
[model] | ||
input_dim = 1 | ||
output_dim = 1 | ||
embed_dim = 2 | ||
rnn_units = 64 | ||
num_layers = 2 | ||
cheb_order = 2 | ||
|
||
[train] | ||
loss_func = mae | ||
seed = 10 | ||
batch_size = 64 | ||
epochs = 100 | ||
lr_init = 0.003 | ||
lr_decay = False | ||
lr_decay_rate = 0.3 | ||
lr_decay_step = 5,20,40,70 | ||
early_stop = True | ||
early_stop_patience = 15 | ||
grad_norm = False | ||
max_grad_norm = 5 | ||
real_value = True | ||
|
||
[test] | ||
mae_thresh = None | ||
mape_thresh = 0. | ||
|
||
[log] | ||
log_step = 20 | ||
plot = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
[data] | ||
num_nodes = 250 | ||
lag = 12 | ||
horizon = 12 | ||
val_ratio = 0.2 | ||
test_ratio = 0.2 | ||
tod = False | ||
normalizer = std | ||
column_wise = False | ||
default_graph = True | ||
|
||
[model] | ||
input_dim = 2 | ||
output_dim = 2 | ||
embed_dim = 2 | ||
rnn_units = 64 | ||
num_layers = 2 | ||
cheb_order = 2 | ||
|
||
[train] | ||
loss_func = mae | ||
seed = 12 | ||
batch_size = 64 | ||
epochs = 100 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[data] | ||
num_nodes = 228 | ||
lag = 12 | ||
horizon = 12 | ||
val_ratio = 0.1 | ||
test_ratio = 0.2 | ||
tod = False | ||
normalizer = std | ||
column_wise = False | ||
default_graph = True | ||
|
||
[model] | ||
input_dim = 1 | ||
output_dim = 1 | ||
embed_dim = 2 | ||
rnn_units = 64 | ||
num_layers = 2 | ||
cheb_order = 2 | ||
|
||
[train] | ||
loss_func = mae | ||
seed = 10 | ||
batch_size = 64 | ||
epochs = 100 | ||
lr_init = 0.003 | ||
lr_decay = False | ||
lr_decay_rate = 0.3 | ||
lr_decay_step = 5,20,40,70 | ||
early_stop = True | ||
early_stop_patience = 15 | ||
grad_norm = False | ||
max_grad_norm = 5 | ||
real_value = True | ||
|
||
[test] | ||
mae_thresh = None | ||
mape_thresh = 0. | ||
|
||
[log] | ||
log_step = 20 | ||
plot = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[data] | ||
num_nodes = 524 | ||
lag = 12 | ||
horizon = 12 | ||
val_ratio = 0.1 | ||
test_ratio = 0.2 | ||
tod = False | ||
normalizer = std | ||
column_wise = False | ||
default_graph = True | ||
|
||
[model] | ||
input_dim = 1 | ||
output_dim = 1 | ||
embed_dim = 2 | ||
rnn_units = 64 | ||
num_layers = 2 | ||
cheb_order = 2 | ||
|
||
[train] | ||
loss_func = mae | ||
seed = 10 | ||
batch_size = 64 | ||
epochs = 100 | ||
lr_init = 0.003 | ||
lr_decay = False | ||
lr_decay_rate = 0.3 | ||
lr_decay_step = 5,20,40,70 | ||
early_stop = True | ||
early_stop_patience = 15 | ||
grad_norm = False | ||
max_grad_norm = 5 | ||
real_value = True | ||
|
||
[test] | ||
mae_thresh = None | ||
mape_thresh = 0. | ||
|
||
[log] | ||
log_step = 20 | ||
plot = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[data] | ||
num_nodes = 211 | ||
len_input = 12 | ||
num_for_predict = 12 | ||
|
||
[model] | ||
nb_block = 2 | ||
K = 3 | ||
nb_chev_filter = 64 | ||
nb_time_filter = 64 | ||
time_strides = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[data] | ||
num_nodes = 250 | ||
len_input = 12 | ||
num_for_predict = 12 | ||
|
||
[model] | ||
nb_block = 2 | ||
K = 3 | ||
nb_chev_filter = 64 | ||
nb_time_filter = 64 | ||
time_strides = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[data] | ||
num_nodes = 228 | ||
len_input = 12 | ||
num_for_predict = 12 | ||
|
||
[model] | ||
nb_block = 2 | ||
K = 3 | ||
nb_chev_filter = 64 | ||
nb_time_filter = 64 | ||
time_strides = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[data] | ||
num_nodes = 524 | ||
len_input = 12 | ||
num_for_predict = 12 | ||
|
||
[model] | ||
nb_block = 2 | ||
K = 3 | ||
nb_chev_filter = 64 | ||
nb_time_filter = 64 | ||
time_strides = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import argparse | ||
# import numpy as np | ||
import configparser | ||
# import pandas as pd | ||
|
||
def parse_args(device): | ||
# parser | ||
args = argparse.ArgumentParser(prefix_chars='-', description='pretrain_arguments') | ||
args_get, _ = args.parse_known_args() | ||
# get configuration | ||
config_file = '../conf/FlashST/config.conf' | ||
config = configparser.ConfigParser() | ||
config.read(config_file) | ||
|
||
# parser | ||
args = argparse.ArgumentParser(prefix_chars='-', description='arguments') | ||
|
||
args.add_argument('-cuda', default=True, type=bool) | ||
args.add_argument('-device', default=device, type=str, help='indices of GPUs') | ||
args.add_argument('-mode', default='ori', type=str, required=True) | ||
args.add_argument('-model', default='STGCN', type=str) | ||
args.add_argument('-dataset_test', default='PEMS07M', type=str) | ||
args.add_argument('-dataset_use', default=config['data']['dataset_use'].split(',')) | ||
|
||
# data | ||
args.add_argument('-his', default=config['data']['his'], type=int) | ||
args.add_argument('-pred', default=config['data']['pred'], type=int) | ||
args.add_argument('-val_ratio', default=config['data']['val_ratio'], type=float) | ||
args.add_argument('-test_ratio', default=config['data']['test_ratio'], type=float) | ||
args.add_argument('-tod', default=config['data']['tod'], type=eval) | ||
args.add_argument('-normalizer', default=config['data']['normalizer'], type=str) | ||
args.add_argument('-column_wise', default=config['data']['column_wise'], type=eval) | ||
args.add_argument('-default_graph', default=config['data']['default_graph'], type=eval) | ||
# model | ||
args.add_argument('-input_base_dim', default=config['model']['input_base_dim'], type=int) | ||
args.add_argument('-input_extra_dim', default=config['model']['input_extra_dim'], type=int) | ||
args.add_argument('-output_dim', default=config['model']['output_dim'], type=int) | ||
args.add_argument('-node_dim', default=config['model']['node_dim'], type=int) | ||
args.add_argument('-embed_dim', default=config['model']['embed_dim'], type=int) | ||
args.add_argument('-num_layer', default=config['model']['num_layer'], type=int) | ||
args.add_argument('-temp_dim_tid', default=config['model']['temp_dim_tid'], type=int) | ||
args.add_argument('-temp_dim_diw', default=config['model']['temp_dim_diw'], type=int) | ||
args.add_argument('-use_lpls', default=config['model']['use_lpls'], type=eval) | ||
args.add_argument('-if_time_in_day', default=config['model']['if_time_in_day'], type=eval) | ||
args.add_argument('-if_day_in_week', default=config['model']['if_day_in_week'], type=eval) | ||
args.add_argument('-if_spatial', default=config['model']['if_spatial'], type=eval) | ||
# train | ||
# args.add_argument('-mode', default=config['train']['mode'], type=str) | ||
args.add_argument('-loss_func', default=config['train']['loss_func'], type=str) | ||
args.add_argument('-seed', default=config['train']['seed'], type=int) | ||
args.add_argument('-batch_size', default=config['train']['batch_size'], type=int) | ||
args.add_argument('-lr_init', default=config['train']['lr_init'], type=float) | ||
args.add_argument('-lr_decay', default=config['train']['lr_decay'], type=eval) | ||
args.add_argument('-lr_decay_rate', default=config['train']['lr_decay_rate'], type=float) | ||
args.add_argument('-lr_decay_step', default=config['train']['lr_decay_step'], type=str) | ||
args.add_argument('-early_stop', default=config['train']['early_stop'], type=eval) | ||
args.add_argument('-early_stop_patience', default=config['train']['early_stop_patience'], type=int) | ||
args.add_argument('-grad_norm', default=config['train']['grad_norm'], type=eval) | ||
args.add_argument('-max_grad_norm', default=config['train']['max_grad_norm'], type=int) | ||
args.add_argument('-real_value', default=config['train']['real_value'], type=eval, | ||
help='use real value for loss calculation') | ||
args.add_argument('-pretrain_epochs', default=config['train']['pretrain_epochs'], type=int) | ||
args.add_argument('-eval_epochs', default=config['train']['eval_epochs'], type=int) | ||
args.add_argument('-ori_epochs', default=config['train']['ori_epochs'], type=int) | ||
args.add_argument('-load_pretrain_path', default=config['train']['load_pretrain_path'], type=str) | ||
args.add_argument('-save_pretrain_path', default=config['train']['save_pretrain_path'], type=str) | ||
args.add_argument('-debug', default=config['train']['debug'], type=str) | ||
# test | ||
args.add_argument('-mae_thresh', default=config['test']['mae_thresh'], type=eval) | ||
args.add_argument('-mape_thresh', default=config['test']['mape_thresh'], type=float) | ||
# log | ||
args.add_argument('-log_dir', default='./', type=str) | ||
args.add_argument('-log_step', default=config['log']['log_step'], type=int) | ||
args.add_argument('-plot', default=config['log']['plot'], type=eval) | ||
args, _ = args.parse_known_args() | ||
return args |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
[new_para] | ||
# dataset_use = ['PEMS08', 'PEMS04', 'PEMS07', 'PEMS03'] | ||
[data] | ||
dataset_use = PEMS08,PEMS04,PEMS07,PEMS03 | ||
# dataset_use = PEMS08,PEMS04 | ||
dataset_test = PEMS07M # NYC_BIKE, CA_District5, PEMS07M, chengdu_didi | ||
his = 12 | ||
pred = 12 | ||
val_ratio = 0.2 | ||
test_ratio = 0.2 | ||
tod = False | ||
normalizer = std | ||
column_wise = False | ||
default_graph = True | ||
|
||
[model] | ||
input_base_dim = 1 | ||
input_extra_dim = 2 | ||
output_dim = 1 | ||
use_lpls = False | ||
node_dim = 32 | ||
embed_dim = 32 | ||
num_layer = 3 | ||
temp_dim_tid = 32 | ||
temp_dim_diw = 32 | ||
if_time_in_day = True | ||
if_day_in_week = True | ||
if_spatial = True | ||
|
||
|
||
[train] | ||
loss_func = mask_mae | ||
seed = 0 | ||
batch_size = 64 | ||
lr_init = 0.003 | ||
lr_decay = True | ||
lr_decay_rate = 0.3 | ||
lr_decay_step = 70, 160, 240 | ||
early_stop = True | ||
early_stop_patience = 25 | ||
grad_norm = True | ||
max_grad_norm = 5 | ||
real_value = False | ||
pretrain_epochs = 300 | ||
eval_epochs = 20 | ||
ori_epochs = 100 | ||
load_pretrain_path = GWN_P8437.pth | ||
save_pretrain_path = P8437_stgcn.pth | ||
debug = True | ||
|
||
[test] | ||
mae_thresh = 0. | ||
mape_thresh = 0.001 | ||
|
||
|
||
[log] | ||
log_step = 20 | ||
plot = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[general] | ||
device = cuda:0 | ||
|
||
[data] | ||
num_nodes = 211 | ||
input_window = 12 | ||
output_window = 12 | ||
output_dim = 1 | ||
|
||
[model] | ||
dropout = 0.3 | ||
blocks = 4 | ||
layers = 2 | ||
gcn_bool = True | ||
addaptadj = True | ||
adjtype = doubletransition | ||
randomadj = True | ||
aptonly = True | ||
kernel_size = 2 | ||
nhid = 32 | ||
residual_channels = 32 | ||
dilation_channels = 32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[general] | ||
device = cuda:0 | ||
|
||
[data] | ||
num_nodes = 250 | ||
input_window = 12 | ||
output_window = 12 | ||
output_dim = 1 | ||
|
||
[model] | ||
dropout = 0.3 | ||
blocks = 4 | ||
layers = 2 | ||
gcn_bool = True | ||
addaptadj = True | ||
adjtype = doubletransition | ||
randomadj = True | ||
aptonly = True | ||
kernel_size = 2 | ||
nhid = 32 | ||
residual_channels = 32 | ||
dilation_channels = 32 |
Oops, something went wrong.