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

What is "zero_module" for? #13

Open
JeremyCJM opened this issue Oct 25, 2022 · 1 comment
Open

What is "zero_module" for? #13

JeremyCJM opened this issue Oct 25, 2022 · 1 comment

Comments

@JeremyCJM
Copy link

Hi Mingyuan,

Why zero out the parameters of the "self.out" projection module in transformers.py?

Thanks,
Jeremy

@mingyuan-zhang
Copy link
Owner

This trick is also used in GLIDE and other Text-to-Image Generation. Zero out self.out can enforce the output to be a zero vector. The learning target of our model is the added Gaussian Noise, whose expected mean is also zero. Therefore, our model can be trained steadily with this trick.

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

2 participants