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

Method _reset_parameters

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

Source from the content-addressed store, hash-verified

228 self.decoder.rm_detach = rm_detach
229
230 def _reset_parameters(self):
231 for p in self.parameters():
232 if p.dim() > 1:
233 nn.init.xavier_uniform_(p)
234
235 for m in self.modules():
236 if isinstance(m, MSDeformAttn):
237 m._reset_parameters()
238
239 if self.num_feature_levels > 1 and self.level_embed is not None:
240 nn.init.normal_(self.level_embed)
241
242 if self.two_stage_learn_wh:
243 nn.init.constant_(self.two_stage_wh_embedding.weight,
244 math.log(0.05 / (1 - 0.05)))
245
246 def get_valid_ratio(self, mask):
247 _, H, W = mask.shape

Callers 2

__init__Method · 0.95
_reset_parametersMethod · 0.45

Calls 1

parametersMethod · 0.80

Tested by

no test coverage detected