高频系数沿时间求标准差与RMS,低频特征提供主预测和门控;两路融合后重排为时间步×节点×分位输出。
(2,16,5,1) / (2,12,5,3);low_features BD N1;high_wave BTNF,T>1(2,6,5,3);原始分位预测B×horizon×N×Q780 个总参数;其中 780 个可训练。low_dim=16、high_feat_dim=3、horizon=6、Q=3、hidden=6、gating=True;图时序分位预测的融合头forward() 数据流顺序拆解 · 点击任意子模块方块可同步查看对应源码切片低频B×16×5×1经1×1头预测18通道;高频B×12×5×3沿时间聚合为std/RMS共6通道,经MLP也生成18通道。低频条件sigmoid门调制高频残差,再重排为B×6×5×3。 本页使用 low_dim=16、high_feat_dim=3、horizon=6、Q=3、hidden=6、gating=True,以真实模块 forward_hook 记录子层输入输出,并追踪本文件执行行上的张量形状。
44 def forward(self,low_features,high_wave): 45 B,_,N,_=low_features.shape46 low_out=self.low_out_proj(low_features).squeeze(-1)47 high_out=self.high_stats_mlp(_high_frequency_stats(high_wave)).squeeze(-1)48 if self.enable_gating and self.gate_proj is not None:49 gate=torch.sigmoid(self.gate_proj(low_features).squeeze(-1))50 fused=low_out+gate*high_out51 else:52 fused=low_out+high_out53 return fused.view(B,self.horizon,self.q_dim,N).permute(0,1,3,2).contiguous()
宿主完成图小波频带提取及低频骨干编码后,使用该头产生原始分位预测。
from SCALEExchangeableFusionHead import SCALEExchangeableFusionHead head = SCALEExchangeableFusionHead(16,3,6,3) quantiles = head(low_features, high_wave)
Method 动机参考:保留低频主干的时序表示,同时用不依赖高频时间排列的能量与波动统计补充分位预测。
| 消融变体 | 结构配置 | 验证目的 |
|---|---|---|
| 高频补充 | 令 high_out=0 | 得到低频预测基线 |
| 条件门控 | enable_gating=False | 比较低频条件调节 |
| 统计组成 | 仅std或仅RMS | 比较波动与能量信息,需同步改输入宽度 |