Comments (3)
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.
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.
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)
- Embedding a VERY LARGE graph, upcoming? HOT 2
- When saving large graph, creating a temporary folder will cause the system disk resources to be exhausted. HOT 1
- Issue with gensim 4.0.0+ HOT 3
- is it possible to split n2v to generate walks only? HOT 4
- node2vec uses CBOW instead of skip-gram HOT 4
- Setting value of seed to make Node2vec embedding repeatable. HOT 1
- Print training progression (node2vec)? HOT 1
- Continue fitting process HOT 2
- About painting HOT 1
- defining random state or seed option parameters HOT 3
- Why is generating walks so slow with non-default parameters? HOT 3
- word2vec parameters changed HOT 3
- Problem with underlying Word2vec HOT 1
- G.mat got an asymmetric sparse matrix
- ProNE option: "inconsistent shapes" error
- Node2Vec:About the return_weight and neighbor_weight
- ProNE multithread HOT 1
- NetworkX 3.0 remove adj_matrix in version HOT 1
- Old parameter shows up in Word2Vec call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodevectors.