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

Dropout in last layer #16

Open
foxtrotmike opened this issue Sep 20, 2020 · 2 comments
Open

Dropout in last layer #16

foxtrotmike opened this issue Sep 20, 2020 · 2 comments

Comments

@foxtrotmike
Copy link

Thank you for your work.
You have used dropout prior to computing the output from each layer. What is the role of this dropout?
See:

score_over_layer += F.dropout(self.linears_prediction[layer](pooled_h), self.final_dropout, training = self.training)

@weihua916
Copy link
Owner

It's just a regularization.

@foxtrotmike
Copy link
Author

Thank you for your response - Tome, it makes sense to regularize using dropout at layers before the last one. Dropout at the prediction output forces prediction scores of an example to become zero and also scales up the prediction scores of other examples in the batch. Please see: "Furthermore, the outputs are scaled by a factor of \frac{1}{1-p}" in https://pytorch.org/docs/stable/generated/torch.nn.Dropout.html
It would be great if you could help me understand this a bit better. Thanks, again.

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