Giter Site home page Giter Site logo

Comments (3)

VHRanger avatar VHRanger commented on July 19, 2024

So the Node2Vec implementation here pretty transparently uses Gensim's word2vec implementation right here:

https://github.com/VHRanger/nodevectors/blob/master/nodevectors/node2vec.py#L130

So the w2vparams you pass should be passed along to the underlying gensim Word2Vec model. If there are weird issues underlying (like the sg=50 thing) it could be related to your gensim version, etc. which I'd have a hard time debugging for you

Secondly: instead of saving embeddings and then loading them as keyedvectors with word2vec - is there a way of converting the fitted object (n2v above) directly to a Word2Vec gensim object?

You could extract the Word2Vec object from the gensim object using the .model attribute of the Node2Vec class, unless I understand this question incorrectly

from nodevectors.

amjass12 avatar amjass12 commented on July 19, 2024

Hi @VHRanger ,

Thank you for the quick response.

To answer your second point first - yes, .model retrieves the full gensim model (thank you, I clearly missed that).

I am still confused about point number 1 and the proper way to implement it. Indeed it. might be a Gensim version issue (3.8.0 for me) - When I add the following:

n2v = Node2Vec(n_components=32, walklen=80, epochs=100, keep_walks=True, w2vparams={'sg':50})

again - on purpose to try and invoke an error (which it doesn't) the model trains, and if i call n2v.model.sg - it shows 50. To this end, I'm very confused as it can only train CBOW or SG so i don't know which model is being trained - if when I do w2vparams={'sg':1} - i dont know if it is actually training the SG model...

Please could you clarify on the correct way to specify the w2vparams in Node2Vec - is there another way to verify it has used Skip-gram and not CBOW?

I also get this when running (Macbook) - WARNING: gensim word2vec version is unoptimizedTry version 3.6 if on windows - Is 3.6 the version that is optimized on the Mac as well? thank you!

from nodevectors.

amjass12 avatar amjass12 commented on July 19, 2024

Hi @VHRanger ,

I was wondering if you could take a look at the comment above? I am worried about the skip-gram parameter and want to make sure that the model is indeed training skip-gram and not CBOW: is the correct way to specify the skip-gram paramtr:

n2v = Node2Vec(n_components=32, walklen=80, epochs=100, keep_walks=True, w2vparams={'sg':1})

thank you!

from nodevectors.

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.