MCPcopy Create free account
hub / github.com/MotrixLab/AiOS / _reset_parameters

Method _reset_parameters

models/aios/transformer.py:2268–2282  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2266 self.decoder.rm_detach = rm_detach
2267
2268 def _reset_parameters(self):
2269 for p in self.parameters():
2270 if p.dim() > 1:
2271 nn.init.xavier_uniform_(p)
2272
2273 for m in self.modules():
2274 if isinstance(m, MSDeformAttn):
2275 m._reset_parameters()
2276
2277 if self.num_feature_levels > 1 and self.level_embed is not None:
2278 nn.init.normal_(self.level_embed)
2279
2280 if self.two_stage_learn_wh:
2281 nn.init.constant_(self.two_stage_wh_embedding.weight,
2282 math.log(0.05 / (1 - 0.05)))
2283
2284 def get_valid_ratio(self, mask):
2285 _, H, W = mask.shape

Callers 1

__init__Method · 0.95

Calls 2

parametersMethod · 0.80
_reset_parametersMethod · 0.45

Tested by

no test coverage detected