MCPcopy Create free account
hub / github.com/THUDM/GLM / BertOnlyMLMHead

Class BertOnlyMLMHead

model/modeling_bert.py:652–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650
651
652class BertOnlyMLMHead(nn.Module):
653 def __init__(self, config, bert_model_embedding_weights):
654 super(BertOnlyMLMHead, self).__init__()
655 self.predictions = BertLMPredictionHead(config, bert_model_embedding_weights)
656
657 def forward(self, sequence_output):
658 prediction_scores = self.predictions(sequence_output)
659 return prediction_scores
660
661
662class BertOnlyNSPHead(nn.Module):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected