pytorch-seq2seq icon indicating copy to clipboard operation
pytorch-seq2seq copied to clipboard

Copy decoder in copy branch

Open Zhujunnan opened this issue 6 years ago • 2 comments

Hi, I have seen your implement about copynet and I have a question. In your code, you directly concatenate vocab_prob with copy_prob, but there are some words , which are not oov words, in these two probability distributions. So if you return such a probability distribution, how do you calculate the NLLLoss in later step? Looking forward to your reply, thanks!

Zhujunnan avatar Nov 29 '17 06:11 Zhujunnan

I haven't finished the implementation yet. But you will have to move the probability mass of those non-OOV words from copy_prob to vocab_prob with something similar to here

kylegao91 avatar Nov 29 '17 14:11 kylegao91

The code seems to take an in-place operation, I am not sure whether it can be backward or not.

Zhujunnan avatar Nov 29 '17 15:11 Zhujunnan