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

Node (names | ids) in the output of the deepwalk-c? #7

Open
plumdeq opened this issue Dec 22, 2017 · 1 comment
Open

Node (names | ids) in the output of the deepwalk-c? #7

plumdeq opened this issue Dec 22, 2017 · 1 comment

Comments

@plumdeq
Copy link

plumdeq commented Dec 22, 2017

Hey,

I've been playing with your implementation of deepwalk, and couldn't really wrap my head what is the format output of the binary file? If I read it into a numpy array how can I recover the ids of the nodes?

Do you have a suggestion how rewrite the binary output into an ASCII or UTF-8 format as below?

node_i emb^i_1 emb^i_2 ... emb^i_d
...
node_n emb^n_1 emb^n_2 ... emb^n_d
@xgfs
Copy link
Owner

xgfs commented Jan 14, 2018

You can quite literally do np.fromfile('datafilepath', np.float32).reshape(num_vertices, dimensions)

Please note that for performance I do not use custom node_ids in the data format (i.e. nodes are renamed). You can see it in the conversion script. Node ids are preserved like sorted(initial_ids).

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