yuqinie98 / PatchTST

An offical implementation of PatchTST: "A Time Series is Worth 64 Words: Long-term Forecasting with Transformers." (ICLR 2023) https://arxiv.org/abs/2211.14730
Apache License 2.0
1.37k stars 248 forks source link

将PatchTST的多头注意力修改为ProbAttention #37

Closed oushilin closed 1 year ago

oushilin commented 1 year ago

我注意到作者论文中使用的是transformer的encoder和decoder 如果我想要将PatchTST和informer结合,将多头注意力改为ProbAttention 请问我应该修改代码中的哪一部分呢?

yuqinie98 commented 1 year ago

你好!你可以修改:https://github.com/yuqinie98/PatchTST/blob/main/PatchTST_supervised/layers/PatchTST_backbone.py#L201。 我们这里用了最原始的transformer, 你可以改成任何其他的former。我们的model有encoder和heads, 没有 transformer decoder的部分。