phanein / deepwalk

DeepWalk - Deep Learning for Graphs
http://www.perozzi.net/projects/deepwalk/
Other
2.68k stars 826 forks source link

several code changes during my test #130

Open godlockin opened 3 years ago

godlockin commented 3 years ago

I did the following changes during my using this lib, but i'm not sure if bugs involved in my changes.

OS: Mac Python: 3.8

steps:

  1. install changed requirements.txt from
    psutil>=2.1.1
    networkx>=2.0

    into

    psutil>=5.8.0
    networkx>=2.6.3

to fix the dependencies analysis issue

  1. init env remove the line from gensim.models.word2vec import Vocab from skipgram.py (line 8) as the Vocab doesn't belong to the gensim.models.vord2vec any more, and it will cause a compile issue

  2. run the function migrate model = Word2Vec(walks, size=args.representation_size, window=args.window_size, min_count=0, sg=1, hs=1, workers=args.workers) into model = Word2Vec(walks, vector_size=args.representation_size, window=args.window_size, min_count=0, sg=1, hs=1, workers=args.workers)

as the param of size doesn't in word2vec.py, and I'm not sure if the representation_size is the vector_size as the description of api: vector_size : int, optional, Dimensionality of the word vectors.