MCPcopy Create free account
hub / github.com/HIT-SCIR/plm-nlp-code / init_weights

Function init_weights

chp6/utils.py:61–66  ·  view source on GitHub ↗
(model)

Source from the content-addressed store, hash-verified

59 return data_loader
60
61def init_weights(model):
62 for name, param in model.named_parameters():
63 if "embedding" not in name:
64 torch.nn.init.uniform_(
65 param, a=-WEIGHT_INIT_RANGE, b=WEIGHT_INIT_RANGE
66 )
67

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected