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

Any further explanation on adding noise to embedding on forward call #10

Open
po-oya opened this issue Nov 10, 2019 · 0 comments
Open

Comments

@po-oya
Copy link

po-oya commented Nov 10, 2019

        emb, sigma = embedded_dropout(self.encoder, torch.ones_like(self.encoder.weight), input,
                                      dropout=self.dropoute if self.training else 0,
                                      is_training=self.training)
        if self.training:
            m = torch.distributions.normal.Normal(torch.zeros_like(sigma), torch.ones_like(sigma) * 1)
            sigma = m.sample() * 0.2
            emb += sigma 

Above lines are from lm/model.py, I was going to ask what is the neccessaty of adding noise to embedding outputs? what this helps to?

Thanks

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