Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] main from thuml:main #29

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion exp/exp_long_term_forecasting.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def test(self, setting, test=0):
dtw_list.append(d)
dtw = np.array(dtw_list).mean()
else:
dtw = -999
dtw = 'not calculated'


mae, mse, rmse, mape, mspe = metric(preds, trues)
Expand Down
6 changes: 3 additions & 3 deletions layers/SelfAttention_Family.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,11 @@ def __init__(self, configs,
super(TwoStageAttentionLayer, self).__init__()
d_ff = d_ff or 4 * d_model
self.time_attention = AttentionLayer(FullAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention), d_model, n_heads)
output_attention=False), d_model, n_heads)
self.dim_sender = AttentionLayer(FullAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention), d_model, n_heads)
output_attention=False), d_model, n_heads)
self.dim_receiver = AttentionLayer(FullAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention), d_model, n_heads)
output_attention=False), d_model, n_heads)
self.router = nn.Parameter(torch.randn(seg_num, factor, d_model))

self.dropout = nn.Dropout(dropout)
Expand Down
3 changes: 1 addition & 2 deletions models/Autoformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def __init__(self, configs):
self.seq_len = configs.seq_len
self.label_len = configs.label_len
self.pred_len = configs.pred_len
self.output_attention = configs.output_attention

# Decomp
kernel_size = configs.moving_avg
Expand All @@ -36,7 +35,7 @@ def __init__(self, configs):
EncoderLayer(
AutoCorrelationLayer(
AutoCorrelation(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention),
output_attention=False),
configs.d_model, configs.n_heads),
configs.d_model,
configs.d_ff,
Expand Down
2 changes: 0 additions & 2 deletions models/FiLM.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,12 @@ def __init__(self, configs):
super(Model, self).__init__()
self.task_name = configs.task_name
self.configs = configs
# self.modes = configs.modes
self.seq_len = configs.seq_len
self.label_len = configs.label_len
self.pred_len = configs.seq_len if configs.pred_len == 0 else configs.pred_len

self.seq_len_all = self.seq_len + self.label_len

self.output_attention = configs.output_attention
self.layers = configs.e_layers
self.enc_in = configs.enc_in
self.e_layers = configs.e_layers
Expand Down
2 changes: 1 addition & 1 deletion models/Informer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, configs):
EncoderLayer(
AttentionLayer(
ProbAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention),
output_attention=False),
configs.d_model, configs.n_heads),
configs.d_model,
configs.d_ff,
Expand Down
3 changes: 1 addition & 2 deletions models/Nonstationary_Transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def __init__(self, configs):
self.pred_len = configs.pred_len
self.seq_len = configs.seq_len
self.label_len = configs.label_len
self.output_attention = configs.output_attention

# Embedding
self.enc_embedding = DataEmbedding(configs.enc_in, configs.d_model, configs.embed, configs.freq,
Expand All @@ -62,7 +61,7 @@ def __init__(self, configs):
EncoderLayer(
AttentionLayer(
DSAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention), configs.d_model, configs.n_heads),
output_attention=False), configs.d_model, configs.n_heads),
configs.d_model,
configs.d_ff,
dropout=configs.dropout,
Expand Down
2 changes: 1 addition & 1 deletion models/PatchTST.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def __init__(self, configs, patch_len=16, stride=8):
EncoderLayer(
AttentionLayer(
FullAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention), configs.d_model, configs.n_heads),
output_attention=False), configs.d_model, configs.n_heads),
configs.d_model,
configs.d_ff,
dropout=configs.dropout,
Expand Down
3 changes: 1 addition & 2 deletions models/Transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ def __init__(self, configs):
super(Model, self).__init__()
self.task_name = configs.task_name
self.pred_len = configs.pred_len
self.output_attention = configs.output_attention
# Embedding
self.enc_embedding = DataEmbedding(configs.enc_in, configs.d_model, configs.embed, configs.freq,
configs.dropout)
Expand All @@ -28,7 +27,7 @@ def __init__(self, configs):
EncoderLayer(
AttentionLayer(
FullAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention), configs.d_model, configs.n_heads),
output_attention=False), configs.d_model, configs.n_heads),
configs.d_model,
configs.d_ff,
dropout=configs.dropout,
Expand Down
3 changes: 1 addition & 2 deletions models/iTransformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ def __init__(self, configs):
self.task_name = configs.task_name
self.seq_len = configs.seq_len
self.pred_len = configs.pred_len
self.output_attention = configs.output_attention
# Embedding
self.enc_embedding = DataEmbedding_inverted(configs.seq_len, configs.d_model, configs.embed, configs.freq,
configs.dropout)
Expand All @@ -27,7 +26,7 @@ def __init__(self, configs):
EncoderLayer(
AttentionLayer(
FullAttention(False, configs.factor, attention_dropout=configs.dropout,
output_attention=configs.output_attention), configs.d_model, configs.n_heads),
output_attention=False), configs.d_model, configs.n_heads),
configs.d_model,
configs.d_ff,
dropout=configs.dropout,
Expand Down
1 change: 0 additions & 1 deletion utils/print_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def print_args(args):
print(f' {"Moving Avg:":<20}{args.moving_avg:<20}{"Factor:":<20}{args.factor:<20}')
print(f' {"Distil:":<20}{args.distil:<20}{"Dropout:":<20}{args.dropout:<20}')
print(f' {"Embed:":<20}{args.embed:<20}{"Activation:":<20}{args.activation:<20}')
print(f' {"Output Attention:":<20}{args.output_attention:<20}')
print()

print("\033[1m" + "Run Parameters" + "\033[0m")
Expand Down