-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Word2vec example #270
Word2vec example #270
Conversation
We'll release this PR without GPU mode (#264). GPU mode will be supported in 1.2.0. |
Although this PR is added to v1.1.2 Milestone, it must be preceded by #264, which is a feature PR. |
No, I removed #264 from this PR. It can work with HSM (only CPU), NS(both CPU and GPU), original (both CPU and GPU). |
@unnonouno OK, I understand it. |
|
||
index2word = {} | ||
word2index = {} | ||
counts = collections.defaultdict(lambda: 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int
can be used instead of lambda: 0
. You can also use collections.Counter.
LGTM except two comments! |
Thank you! |
I implemented word2vec example including skip-gram architecture and continuous-bow architecture with HSM and negative sampling.
Note that this implementation is slower than the original even when you use GPU.
Please review this PR after #264