Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Add dropout option for BERT Pooler #3109

Merged
merged 5 commits into from
Aug 12, 2019
Merged

Add dropout option for BERT Pooler #3109

merged 5 commits into from
Aug 12, 2019

Conversation

lucky-bai
Copy link
Contributor

This adds an optional dropout to BERT after the pooling operation but before the final feedforward. This mirrors BertForClassification, which has a dropout at this step.

def __init__(self, pretrained_model: Union[str, BertModel], requires_grad: bool = True) -> None:
def __init__(self,
pretrained_model: Union[str, BertModel],
dropout: float = 0.0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you change the position of this argument to be last, so that it doesn't introduce a breaking change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done

@DeNeutoy DeNeutoy merged commit 9093f47 into allenai:master Aug 12, 2019
reiyw pushed a commit to reiyw/allennlp that referenced this pull request Nov 12, 2019
* Add dropout option for BERT Pooler

* Change order of arguments
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants