You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experimented with the embedding code provided by this author, and it took me nearly a month, and it didn't work, and I almost crashed. When I checked my algorithm for a number of times, I finally found that there was a problem with the deepwalk code provided by this author. If you want to use deepwalk, please use https://github.com/phanein/deepwalk.
Activity
shenweichen commentedon Apr 21, 2020
您好~ 目前deepwalk已知问题是对于独立点会存在将自身作为邻居顶点进行采样的问题,这是由于
networkx的邻居获取机制导致的。不知您说的是否是这个问题?如果不是这个问题,麻烦指出具体的问题帮助我们进行改进。xiongshuai520 commentedon Apr 21, 2020
我所做的研究中不存在孤立点的情况,所以应该不是你说的独立点重复采样的问题。为了回答你的问题,我做了如下实验,以最经典的karate网络为例(34个节点,不存在孤立点),我使用你提供的deepwalk代码和https://github.com/phanein/deepwalk 提供的代码,在相同参数的情况下(--max-memory-data-size 0 --number-walks 80 --representation-size 17 --walk-length 40 --window-size 10 --workers 1),取100次嵌入结果的平均值对每一个向量做比较,结果如下(从节点1到节点34,使用余弦相似度,调用python函数from sklearn.metrics.pairwise import cosine_similarity):
[0.4607906639208839], [0.14583083343027428], [0.10433700876067258], [0.10585915864593479], [0.29468624241130204], [0.31663012161867626], [0.1933105854441737], [0.3956301179280702], [0.38898165971535015], [0.1936263987721945], [0.3334481587066986], [0.08787716564314624], [0.2703404869330344], [0.5218187333875279], [0.244416501827768], [0.25748774755185555], [0.32319160785761236], [0.009651753567593884], [0.11258320489373647], [0.22947905518395237], [0.23214729423499547], [0.053709737355217675], [0.09656930378263275], [0.08120878398645703], [0.6030732143152714], [0.3215139532708406], [0.011497123270551716], [0.1388385320114997], [0.43689806198566505], [0.04997083306023275], [0.06674077466730642], [0.1447796439960975], [0.22911076195231844], [0.17835644390391345]]
这个差别是巨大的,因为同样的思想写的代码是不可能有如此大的差异的,深入研究后发现是你的代码得到的嵌入向量有问题(我做了聚类,因为涉及到所写paper的研究内容,就不展开了)。
综上所述,我的整个发现问题的过程就是这样,具体代码我没有去查看,你可以重复一下我上述的实验。对比https://github.com/phanein/deepwalk和你的代码deepwalk出来的结果的差异性。
最后,我会关闭这个问题,因为我自己没有时间去解决,而且带了个人情绪去评论你所做的工作,很抱歉。
DachuanZhao commentedon Oct 20, 2020
我看了一下双方的代码,个人感觉deepctr的实现没啥问题,倒是你发的那个github可能会有问题。
问题所在是 : folk出的子进程的random state可能不会是随机的
参考链接:
https://joblib.readthedocs.io/en/latest/auto_examples/parallel_random_state.html#sphx-glr-download-auto-examples-parallel-random-state-py
https://stackoverflow.com/questions/49847794/child-processes-generating-same-random-numbers-as-parent-process
deepctr用的是joblib的多进程,你提供的那个第三方用的是concurrent.futures.ProcessPoolExecutor的多进程,后者的random state可能会存在问题。个人拙见,如有不对,欢迎拍砖。