-
Notifications
You must be signed in to change notification settings - Fork 914
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
support python 3+ on learn_embedding method. #87
Comments
Actually that alone does not fix the issue with Python3 implementation. Above solution I offered has to be changed to the following. def learn_embeddings(walks):
|
why you add '[]' for variable 'walks' again? this mean get walk list embedding instead of node in walks? |
fix at #35 |
hi, thanks your modification! But in my try, walks = [str(walk) for walk in walks] doesn't work, and the final embeddings are of random walks rather than nodes. In my opinion, only list() is needed. Maybe, you can try this walks = [list(map(str, walk)) for walk in walks]. Meanwhile, '[]' can be removed. |
can change this sentence to the origin map function aims to change the type of each element into str |
The following works fine on python3:
|
learn_embeddings needs minor modification to accept the python3+ 's map function. implemented below
def learn_embeddings(walks):
'''
Learn embeddings by optimizing the Skipgram objective using SGD.
'''
#print(type(walks))
#walks = [map(str, walk) for walk in walks]
walks= [str(j) for i in walks for j in i]
The text was updated successfully, but these errors were encountered: