wenzhilics / HomoGCL

"HomoGCL: Rethinking Homophily in Graph Contrastive Learning" in KDD'23
13 stars 2 forks source link

计算对比损失 #3

Open Roiko97 opened 1 year ago

Roiko97 commented 1 year ago

源代码中的负样本计算为,refl_sim.sum(1) + between_sim.sum(1) - refl_sim.diag() - (refl_sim adj1).sum(1) - (between_sim adj2).sum(1);但是根据论文中描述的,不同视图之间的负样本还应该减去节点自身的信息,即 - between_sim.diag()。 我认为最终代码应该修正为:neg = refl_sim.sum(1) + between_sim.sum(1) - refl_sim.diag() - between_sim.diag() - (refl_sim adj1).sum(1) - (between_sim adj2).sum(1)

YanJiangJerry commented 7 months ago

是的