HongyangGao / Graph-U-Nets

Pytorch implementation of Graph U-Nets (ICML19)
http://proceedings.mlr.press/v97/gao19a/gao19a.pdf
GNU General Public License v3.0
513 stars 100 forks source link

批训练问题 #25

Open Joazs opened 1 year ago

Joazs commented 1 year ago

您好,我这里有一批节点特征矩阵,大小为[B,N,C],B是批处理个数,N是节点个数,C是特征维度数;还有一批邻接矩阵[B,N,N]。由于我的邻接矩阵太过稠密,我在使用PYG复现的GraphUNet时显存不足,因为它是用邻接列表存储节点连接关系的。 但是现在我想使用邻接矩阵的形式,请问如何进行批训练呢?

HongyangGao commented 1 year ago

Try this one: https://pytorch.org/docs/stable/generated/torch.sparse.mm.html

Change the adjacency matrix to sparse and do matrix multiplication with sparse.mm.