Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can i get the node's vector after embedding? #19

Closed
hurun opened this issue Jun 3, 2019 · 9 comments
Closed

how can i get the node's vector after embedding? #19

hurun opened this issue Jun 3, 2019 · 9 comments

Comments

@hurun
Copy link

hurun commented Jun 3, 2019

thanks your work,its perfect.
i wonder know how to get the node's vector after embedding.

@hurun
Copy link
Author

hurun commented Jun 3, 2019

if I want the node 2 vector ,how can i write code, is it that
model.wv.vectors[1]

@hurun
Copy link
Author

hurun commented Jun 3, 2019

i have other question about the node.
If the graph structure is changing dynamically, how can you embed only the newly added nodes and not need to process the other nodes so as to save computation

@hurun
Copy link
Author

hurun commented Jun 3, 2019

if I want the node 2 vector ,how can i write code, is it that
model.wv.vectors[1]

i do this, use model.wv.get_vector('2'), your code is amazing :)

@eliorc
Copy link
Owner

eliorc commented Jun 6, 2019

Hi, as stated in the docs, the Node2Vec.fit method returns an instance of gensim.models.Word2Vec, you can see in the documentation how to access vectors

But notice, it is stated in the README, all of your nodes will be strings after using Node2Vec.fit, so you should call '2' and not 2

@hurun
Copy link
Author

hurun commented Jun 8, 2019

Thanks your repay, i can get the vector now with your helper.

I have a problem about dynamic graph .
that is the node in the graph will continue to add new nodes over time. Can I just do node2vec algorithm for the newly added node and its neighbor, and keep the other nodes unchanged

@eliorc
Copy link
Owner

eliorc commented Jun 8, 2019

Nope, node2vec algorithm cannot be incrementally updated...

@hurun
Copy link
Author

hurun commented Jun 8, 2019

Thank you, i will try to read your code and maybe add this function to algorithm.

@eliorc
Copy link
Owner

eliorc commented Jun 8, 2019

Its not about the code, it's about the algorithm, the algorithm is not built for incremental learning

@hurun
Copy link
Author

hurun commented Jun 8, 2019

Yes, your right.
I find a paper about incremental updated, maybe can combine into node2vec
here is paper: Inductive Representation Learning On Large Graphs
code:https://github.com/williamleif/GraphSAGE

@eliorc eliorc closed this as completed Jun 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants