代码:
python
import warnings
warnings.filterwarnings("ignore")
import torch
from torch_geometric.data import Data
x = torch.tensor([[2,1],[5,6],[3,7],[12,0]],dtype=torch.float)
y = torch.tensor([0,1,0,1],dtype=torch.float)
#定义边
edge_index = torch.tensor([[0,1,2,0,3], #起始点
[1,0,1,3,2]],dtype=torch.long) #终止点
data = Data(x=x,edge_index=edge_index,y=y)
print(data)
TopKPooling流程:
对图片进行剪枝操作,选择分低的节点剔除掉,然后再重新组合成一个新的图

图注意力机制与序列图模型:



序列图神经网络(GNN)

