wanghq21 / MICN

Code release of paper "MICN: Multi-scale Local and Global Context Modeling for Long-term Series Forecasting" (ICLR 2023)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

代码运行问题

zixuanxuanxuanxuan opened this issue · comments

RuntimeError: The size of tensor a (120) must match the size of tensor b (72) at non-singleton dimension 1
我想问一下这是什么问题 ,帮忙修改一下 谢谢

我运行时没有出现这个问题,你注意一下这两个点呢
1、seq_len=label_len。
2、embedding的输入是x_mark_dec而不是x_mark_enc(对应到temporal_embedding)。

image
image
但是当我debugETTh1这个数据集的时候,我发现x和x_mark的维度是不同的,请您查看上面的图片,x是seasonal_init_dec,x_mark是x_mark_dec,我发现seasonal_init_dec在上面做了一个concat操作变成了120维,作者可以帮忙改一下吗,谢谢

image

seasonal_init_enc 的shape 是 [batch, seq_len, enc_in], seasonal_init_dec 的shape是 [batch, seq_len+pred_len, enc_in], x_mark_dec的shape是 [batch, label_len+pred_len, 4]。而seq_len=label_len,所以seasonal_init_dec 和x_mark_dec的shape是匹配的。请问那个120和72是在什么情况得到的呢?(什么样的seq_len, label_len 和pred_len呢)

感谢您的回复,我是按照您github库里面的默认设置运行的,在您的设置里面如下图所示
image所以这个seq_len和label_len应该是不相同的

MICN/run.py

Line 33 in 370c69b

parser.add_argument('--seq_len', type=int, default=96, help='input sequence length of Informer encoder')

可能是我的失误,我没有用脚本跑,我看着脚本里面设置的是seq_len=label_len=96,但是我看了其他的模型,这个label_len一半都设置为seq_len的一半,请问将seq_len全部作为label_len有什么意图吗,全部作为解码器的先验吗?

其他模型seq_len 和 label_len 不一样是因为他们是encoder-decoder结构,seq_len 是encoder的输入,而label_len+pred_len是decoder的输入。我们是decoder结构,只需要label_len+pred_len,为了个其他模型统一,我们也设置一个seq_len,和label_len 长度相同就行了。类似于补全的想法。论文中有提及在输入后面直接concat 0。