diff --git a/models/Autoformer.py b/models/Autoformer.py index 70a9784..e3808d9 100644 --- a/models/Autoformer.py +++ b/models/Autoformer.py @@ -26,6 +26,8 @@ def __init__(self, configs): self.label_len = configs.label_len self.pred_len = configs.pred_len self.output_attention = configs.output_attention + self.data = configs.data + self.use_static = True self.static1 = configs.static=="static1" @@ -66,9 +68,10 @@ def __init__(self, configs): # static_raw = torch.tensor([1, 1, 2, 1, 2, 2, 1]) ## synthetic data for ETTh1 ### this is for Divvy bikes - #self.static_raw = torch.tensor(np.load('auxutils/divvy_static.npy').tolist() ) ## static real data for Divvy Bikes - - self.static_raw = torch.tensor(np.load('auxutils/M5_static.npy')[1].tolist() ) ## static real data for Divvy Bikes + if self.data == "Divvy": + self.static_raw = torch.tensor(np.load('auxutils/divvy_static.npy').tolist() ) ## static real data for Divvy Bikes + if self.data == "M5": + self.static_raw = torch.tensor(np.load('auxutils/M5_static.npy')[1].tolist() ) ## static real data for Divvy Bikes #static_raw = static_raw.repeat((32,72,1)) ## for input it should 96, for output it should be 144 self.static_raw = self.static_raw.repeat((32,self.repeat_freq,1)) ## for input it should 96, for output it should be 144 diff --git a/models/DLinear.py b/models/DLinear.py index 25443f9..c9795ff 100644 --- a/models/DLinear.py +++ b/models/DLinear.py @@ -33,7 +33,8 @@ def __init__(self, configs, individual=False): self.static4 = configs.static=="static4" self.static6 = configs.static=="static6" self.static7 = configs.static=="static7" - + self.data = configs.data + print ("self.static1, self.static2, self.static4, self.static6, self.static7", self.static1, self.static2, self.static4, self.static6, self.static7) ## Raman code starts @@ -43,8 +44,10 @@ def __init__(self, configs, individual=False): if (self.use_static): # static_raw = torch.tensor([1, 1, 2, 1, 2, 2, 1]) ## synthetic data for ETTh1 - #self.static_raw = torch.tensor(np.load('auxutils/divvy_static.npy').tolist() ) ## static real data for Divvy Bikes - self.static_raw = torch.tensor(np.load('auxutils/M5_static.npy')[1].tolist() ) ## static real data for Divvy Bikes + if self.data == "Divvy": + self.static_raw = torch.tensor(np.load('auxutils/divvy_static.npy').tolist() ) ## static real data for Divvy Bikes + if self.data == "M5": + self.static_raw = torch.tensor(np.load('auxutils/M5_static.npy')[1].tolist() ) ## static real data for Divvy Bikes #static_raw = static_raw.repeat((32,72,1)) ## for input it should 96, for output it should be 144 #static_raw = static_raw.repeat((32,144,1)) # for Auto and FED former ## for input it should 96, for output it should be 144 diff --git a/models/FEDformer.py b/models/FEDformer.py index e3b6a5c..12feeac 100644 --- a/models/FEDformer.py +++ b/models/FEDformer.py @@ -40,7 +40,7 @@ def __init__(self, configs, version='fourier', mode_select='random', modes=32): self.static6 = configs.static=="static6" self.static7 = configs.static=="static7" self.repeat_freq = self.pred_len + self.label_len - + self.data = configs.data # Decomp self.decomp = series_decomp(configs.moving_avg) @@ -54,8 +54,10 @@ def __init__(self, configs, version='fourier', mode_select='random', modes=32): print ("pred_len, label_len", self.pred_len, self.label_len, self.pred_len + self.label_len) # static_raw = torch.tensor([1, 1, 2, 1, 2, 2, 1]) ## synthetic data for ETTh1 - #self.static_raw = torch.tensor(np.load('auxutils/divvy_static.npy').tolist() ) ## static real data for Divvy Bikes - self.static_raw = torch.tensor(np.load('auxutils/M5_static.npy')[1].tolist() ) ## static real data for Divvy Bikes + if self.data == "Divvy": + self.static_raw = torch.tensor(np.load('auxutils/divvy_static.npy').tolist() ) ## static real data for Divvy Bikes + if self.data == "M5": + self.static_raw = torch.tensor(np.load('auxutils/M5_static.npy')[1].tolist() ) ## static real data for Divvy Bikes #static_raw = static_raw.repeat((32,72,1)) ## for input it should 96, for output it should be 144