weights initialized two times
Hi,
I found that you initilized all weights twice:
The first one is in BertModel class:
https://github.com/huggingface/pytorch-pretrained-BERT/blob/3ba5470eb85464df62f324bea88e20da234c423f/pytorch_pretrained_bert/modeling.py#L586
And the second one is in classes of each tasks such as in BertForSequenceClassification class:
https://github.com/huggingface/pytorch-pretrained-BERT/blob/3ba5470eb85464df62f324bea88e20da234c423f/pytorch_pretrained_bert/modeling.py#L674
I think maybe you only need the second one?
I think it required for both the places. Because both of them can be used individually. As it is mentioned in the README.md file, the model can be loaded with 7 classes. In fact if you check BertForMaskedLM and BertForNextSentencePrediction classes it also has the weights initialised.
Please correct me if I am wrong :)
You are right @Arjunsankarlal :-)