MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / _init_weights

Method _init_weights

PATH/core/models/backbones/vitdet.py:409–416  ·  view source on GitHub ↗
(self, m)

Source from the content-addressed store, hash-verified

407 rescale(layer.mlp.fc2.weight.data, layer_id + 1)
408
409 def _init_weights(self, m):
410 if isinstance(m, nn.Linear):
411 trunc_normal_(m.weight, std=.02)
412 if isinstance(m, nn.Linear) and m.bias is not None:
413 nn.init.constant_(m.bias, 0)
414 elif isinstance(m, nn.LayerNorm):
415 nn.init.constant_(m.bias, 0)
416 nn.init.constant_(m.weight, 1.0)
417
418 @staticmethod
419 def _normalization(x):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected