MCPcopy Create free account
hub / github.com/BeastyZ/ConvSearch-R1 / _init_weights

Method _init_weights

src/eval/models.py:23–28  ·  view source on GitHub ↗

Initialize the weights

(self, module)

Source from the content-addressed store, hash-verified

21 self.use_mean = False
22
23 def _init_weights(self, module):
24 """ Initialize the weights """
25 if isinstance(module, (nn.Linear, nn.Embedding, nn.Conv1d)):
26 # Slightly different from the TF version which uses truncated_normal for initialization
27 # cf https://github.com/pytorch/pytorch/pull/5617
28 module.weight.data.normal_(mean=0.0, std=0.02)
29
30 def query_emb(self, input_ids, attention_mask):
31 outputs1 = self.roberta(input_ids=input_ids,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected