shenweichen / GraphEmbedding

Implementation and experiments of graph embedding algorithms.
MIT License
3.64k stars 990 forks source link

LINE的negative samples #20

Open Salon-sai opened 4 years ago

Salon-sai commented 4 years ago

如果代码没有理解错的话,应该这部分是负采样。 https://github.com/shenweichen/GraphEmbedding/blob/master/ge/models/line.py#L170-L173 但这里的负采样没有剔除相邻节点和自身节点

chenkkkk commented 4 years ago

我也觉得这里没有剔除相邻节点和自身节点

shenweichen commented 4 years ago

@Salon-sai @chenkkkk 原论文中的负采样是直接从一个正比于顶点出度的3/4方的噪声分布中采样目标点的,这个你们可以参考原作者本人的实现