sample = [] # [(week_sample),(day_sample),(hour_sample),target,time_sample]sample.append(hour_sample) # (1, vertices, features, sequences)time_sample # [[14]]用当前12小时的数据预测下一12小时的数据用到num_of_weeks, num_of_days, num_of_hours 3个维度的信息train_x.shapeOut
train_index.shapeOut[30]: (140,)val_index.shapeOut[31]: (500,)test_index.shapeOut[32]: (1000,)x = dataset.x / dataset.x.sum(1, keepdims=True) # 归一化数据,使得每一行和为1x是每个节点(论文文本)的特征, 词带特征Laplasian矩阵的规范化L=D−12(A+I)D−12L=D^{-\frac{1}{2}}(A+I)D^{-\frac{1}
layers.GraphAttentionLayer._prepare_attentional_mechanism_input Wh.shape Out[1]: torch.Size([2708, 8]) Wh_repeated_in_chunks.shape Out[3]: torch.Size([7333264, 8]) N Out[4]: 2708 N**2 Out[5]: 7333264 Wh_repeated_in_chunks.shape == Wh_repeated_alternating.
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号