TianBian95 / BiGCN

Source Codes: Rumor Detection on Social Media with Bi-Directional Graph Convolutional Networks--AAAI 2020
250 stars 73 forks source link

关于代码的疑问:这是bug还是我理解有误? #16

Open Struggle-Forever opened 2 years ago

Struggle-Forever commented 2 years ago

QQ截图20220712121743

flowingrain commented 1 year ago

是有batch个图,但序号不是[0,batch-1]吧

Struggle-Forever commented 1 year ago

是有batch个图,但序号不是[0,batch-1]吧 https://pytorch-geometric.readthedocs.io/en/latest/notes/introduction.html#mini-batches image

flowingrain commented 1 year ago

图片

flowingrain commented 1 year ago

图片

Struggle-Forever commented 1 year ago

图片 为啥打印 batch-data,? data.x的组织形式 是【0,0,1,1,.....】 rootindex = data.rootindex 保存的应该是每张图的根节点索引。 比如说,第一张图的根节点是第3个图节点,第二张图的根节点是第10个图节点,data.rootindex应该是【3,10,...】以此类推。x1[rootindex[num_batch]] 这里是取出来当前一张图的根节点的索引,然后在x1中检索。 在这里我产生疑惑是: 当按照10去x1检索时,取出来的不是第二个图的第10个节点,而是从第一张图开始累积的第10个节点. 不知道我有没有描述清楚我的疑惑? 我并没有打印以上代码,我只是按照作者的代码逻辑,看了一下。

Struggle-Forever commented 1 year ago

图片

如果你运行起来了代码,可以打印一下。也帮助我解决一下我的疑惑,谢谢!

flowingrain commented 1 year ago

图片

如果你运行起来了代码,可以打印一下。也帮助我解决一下我的疑惑,谢谢!

所有节点是一起编号的,为什么要对第二个图再取其中的第十个节点?