Giter VIP home page Giter VIP logo

Comments (3)

xiongshuai520 avatar xiongshuai520 commented on May 11, 2024 14

您好~ 目前deepwalk已知问题是对于独立点会存在将自身作为邻居顶点进行采样的问题,这是由于networkx的邻居获取机制导致的。不知您说的是否是这个问题?如果不是这个问题,麻烦指出具体的问题帮助我们进行改进。

我所做的研究中不存在孤立点的情况,所以应该不是你说的独立点重复采样的问题。为了回答你的问题,我做了如下实验,以最经典的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出来的结果的差异性。
最后,我会关闭这个问题,因为我自己没有时间去解决,而且带了个人情绪去评论你所做的工作,很抱歉。

from graphembedding.

DachuanZhao avatar DachuanZhao commented on May 11, 2024 2

您好~ 目前deepwalk已知问题是对于独立点会存在将自身作为邻居顶点进行采样的问题,这是由于networkx的邻居获取机制导致的。不知您说的是否是这个问题?如果不是这个问题,麻烦指出具体的问题帮助我们进行改进。

我所做的研究中不存在孤立点的情况,所以应该不是你说的独立点重复采样的问题。为了回答你的问题,我做了如下实验,以最经典的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出来的结果的差异性。
最后,我会关闭这个问题,因为我自己没有时间去解决,而且带了个人情绪去评论你所做的工作,很抱歉。

我看了一下双方的代码,个人感觉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可能会存在问题。
个人拙见,如有不对,欢迎拍砖。

from graphembedding.

shenweichen avatar shenweichen commented on May 11, 2024

您好~ 目前deepwalk已知问题是对于独立点会存在将自身作为邻居顶点进行采样的问题,这是由于networkx的邻居获取机制导致的。不知您说的是否是这个问题?如果不是这个问题,麻烦指出具体的问题帮助我们进行改进。

from graphembedding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.