MCPcopy
hub / github.com/open-mmlab/mmpretrain / init_weights

Method init_weights

mmpretrain/models/selfsup/cae.py:405–414  ·  view source on GitHub ↗

Initialize weights.

(self)

Source from the content-addressed store, hash-verified

403 self.teacher = MODELS.build(backbone)
404
405 def init_weights(self) -> None:
406 """Initialize weights."""
407 super().init_weights()
408
409 # init the weights of teacher with those of backbone
410 for param_backbone, param_teacher in zip(self.backbone.parameters(),
411 self.teacher.parameters()):
412 param_teacher.detach()
413 param_teacher.data.copy_(param_backbone.data)
414 param_teacher.requires_grad = False
415
416 def momentum_update(self) -> None:
417 """Momentum update of the teacher network."""

Callers 15

init_weightsMethod · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
test_initializeMethod · 0.45
test_initializeMethod · 0.45
test_initializeMethod · 0.45
test_hybrid_embedFunction · 0.45

Calls

no outgoing calls

Tested by 15

test_initializeMethod · 0.36
test_initializeMethod · 0.36
test_initializeMethod · 0.36
test_hybrid_embedFunction · 0.36
test_drop_layerMethod · 0.36
test_hrnet_arch_zooFunction · 0.36
test_hrnet_custom_archFunction · 0.36
test_init_weightsMethod · 0.36
test_seresnextFunction · 0.36
test_regnet_backboneFunction · 0.36
test_custom_archFunction · 0.36