Informer/Code
encoder 输入
- feature 特征张量 (336,7) + 时间特征张量 (336,4)
decoder 输入
-
feature 特征张量 (336+168,7) + 时间特征张量 (336+168,4)
-
168 是一次需要预测的长度
Encoder
- forward
ProbAttention
1 | def forward(self, queries, keys, values, attn_mask): |
_get_initial_context
- V(B,H,L,E) 求平均变成 V(B,H,E),然后再复制成和原来大小相同的矩阵
_update_context
- 更新 index 指定 30 个位置的值,其他值是
_get_initial_context
初始化的平均结果
_prob_QK
1 | def _prob_QK(self, Q, K, sample_k, n_top): # n_top: c*ln(L_q) |