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

Method init_weights

detrsmpl/models/utils/transformer.py:301–306  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

299 self.embed_dims = self.encoder.embed_dims
300
301 def init_weights(self):
302 # follow the official DETR to init parameters
303 for m in self.modules():
304 if hasattr(m, 'weight') and m.weight.dim() > 1:
305 xavier_init(m, distribution='uniform')
306 self._is_init = True
307
308 def forward(self, x, mask, query_embed, pos_embed):
309 """Forward function for `Transformer`.

Callers 1

init_weightsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected