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

About CopyNet #20

Open
gmftbyGMFTBY opened this issue Mar 11, 2019 · 1 comment
Open

About CopyNet #20

gmftbyGMFTBY opened this issue Mar 11, 2019 · 1 comment

Comments

@gmftbyGMFTBY
Copy link

gmftbyGMFTBY commented Mar 11, 2019

Thanks for your open-source code.
I have a question about your stable version of the copynet.
I find that your version copynet considers about the generation probability of the source tokens, but in the origin paper of CopyNet, they also added some other mechanisms, such as selective read, but I have not found it in your code (Is this version copynet good enough for the Sequicity ?), can you tell me the reason?
Thank you very much!

@gmftbyGMFTBY
Copy link
Author

gmftbyGMFTBY commented Mar 11, 2019

And also in tsd_net.py

    def supervised_loss(self, pz_proba, pm_dec_proba, z_input, m_input):
        pz_proba, pm_dec_proba = pz_proba[:, :, :cfg.vocab_size].contiguous(), pm_dec_proba[:, :,
                                                                               :cfg.vocab_size].contiguous()
        pr_loss = self.pr_loss(pz_proba.view(-1, pz_proba.size(2)), z_input.view(-1))
        m_loss = self.dec_loss(pm_dec_proba.view(-1, pm_dec_proba.size(2)), m_input.view(-1))

        loss = pr_loss + m_loss
        return loss, pr_loss, m_loss

In this function, the pz_proba is the tensor with shape [T, B, V_aug] (in camrest626 dataset V_aug is 8xx [800 + seq_len]), which is generated by copynet. But when you calculate the NLLoss,you only use the vocabulary size which is 800 (In this case, I think that the information about the source sequence is lost). In other words, I don't think it's the CopyNet.

I am confused about it, can you explan it ?

thank you very much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant