XDZhelheim / STAEformer

[CIKM'23] Official code for our paper "Spatio-Temporal Adaptive Embedding Makes Vanilla Transformer SOTA for Traffic Forecasting".
https://arxiv.org/abs/2308.10425
132 stars 16 forks source link

论文中的散点图如何绘制 #15

Open laibajiu opened 1 month ago

laibajiu commented 1 month ago

作者您好,我认真的读了您的论文,请问论文中的Spatial Axis和Temporal Axis这两张图是如何绘制的?

XDZhelheim commented 1 month ago

你好!

  1. 在训练好的模型中提取出 adaptive embedding,尺寸为 (T, N, D)
  2. 时间:reshape -> (T, ND),np.corrcoef() 计算相关系数矩阵 (T, T),matplotlib 画网格图
  3. 空间:reshape -> (N, TD),tsne 降到二维 (N, 2),matplotlib 画散点图