Element-Research / rnn

Recurrent Neural Network library for Torch7's nn
BSD 3-Clause "New" or "Revised" License
939 stars 313 forks source link

The target mask in the noise-contrastive-estimate example #334

Open zhuang-li opened 8 years ago

zhuang-li commented 8 years ago

Hi I see on the blog http://torch.ch/blog/2016/07/25/nce.html that you use the '1' as the target mask as "ClassNLLCriterion will otherwise complain". And I tested, if I use '0', it do won't pass the test. But in the vocab of GBW dataset, "1" means a real word, which is "Third-seeded". So what will happen if the sentence contains the word "Third-seeded". Wouldn't that be a problem? Why can't I just use '0' as the other modules but not in the NCEModule? Why the MaskZero can't handle this situation? Thank you.