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

Word2vec example #270

Merged
merged 5 commits into from
Aug 5, 2015
Merged

Word2vec example #270

merged 5 commits into from
Aug 5, 2015

Conversation

unnonouno
Copy link
Member

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

@unnonouno unnonouno added the cat:example Example, e.g. the MNIST example. label Aug 4, 2015
@unnonouno unnonouno added this to the v1.1.2 milestone Aug 4, 2015
@unnonouno
Copy link
Member Author

We'll release this PR without GPU mode (#264). GPU mode will be supported in 1.2.0.

@delta2323
Copy link
Member

Although this PR is added to v1.1.2 Milestone, it must be preceded by #264, which is a feature PR.
So we must defer merge of this PR at least until next minor release.

@unnonouno
Copy link
Member Author

No, I removed #264 from this PR. It can work with HSM (only CPU), NS(both CPU and GPU), original (both CPU and GPU).
So, it cannot run in GPU mode when a user select HSM (cause NotImplementError). It will work correctly in 1.2.0.

@beam2d beam2d self-assigned this Aug 5, 2015
@delta2323
Copy link
Member

@unnonouno OK, I understand it.


index2word = {}
word2index = {}
counts = collections.defaultdict(lambda: 0)
Copy link
Member

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.

@beam2d
Copy link
Member

beam2d commented Aug 5, 2015

LGTM except two comments!

@beam2d
Copy link
Member

beam2d commented Aug 5, 2015

LGTM

beam2d added a commit that referenced this pull request Aug 5, 2015
@beam2d beam2d merged commit 8809242 into master Aug 5, 2015
@beam2d beam2d deleted the word2vec branch August 5, 2015 06:14
@beam2d
Copy link
Member

beam2d commented Aug 5, 2015

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:example Example, e.g. the MNIST example.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants