def init_weights(self):
        """Initialize weights of the DeformDETR head."""
        self.transformer.init_weights()
        if self.loss_cls.use_sigmoid:
            bias_init = bias_init_with_prob(0.01)
            for m in self.cls_branches:
                nn.init.constant_(m[-1].bias, bias_init)
        if self.loss_map_cls.use_sigmoid:
            bias_init = bias_init_with_prob(0.01)
            for m in self.map_cls_branches:
                nn.init.constant_(m[-1].bias, bias_init)
        if self.loss_mot_cls.use_sigmoid:
            bias_init = bias_init_with_prob(0.01)
            for m in self.mot_cls_branches:
                nn.init.constant_(m[-1].bias, bias_init)
        if self.loss_tl_status_cls.use_sigmoid:
            bias_init = bias_init_with_prob(0.01)
            nn.init.constant_(self.tl_status_cls_branch[-1].bias, bias_init)
        if self.loss_tl_trigger_cls.use_sigmoid:
            bias_init = bias_init_with_prob(0.01)
            nn.init.constant_(self.tl_trigger_cls_branch[-1].bias, bias_init)
        if self.loss_stopsign_trigger_cls.use_sigmoid:
            bias_init = bias_init_with_prob(0.01)
            nn.init.constant_(self.stopsign_trigger_cls_branch[-1].bias, bias_init)
        # if self.plan_cls_col_branch.use_sigmoid:
        #     bias_init = bias_init_with_prob(0.01)
        #     nn.init.constant_(self.plan_cls_col_branch[-1].bias, bias_init)
        # if self.plan_cls_bd_branch.use_sigmoid:
        #     bias_init = bias_init_with_prob(0.01)
        #     nn.init.constant_(self.plan_cls_bd_branch[-1].bias, bias_init)
        # for m in self.map_reg_branches:
        #     constant_init(m[-1], 0, bias=0)
        # nn.init.constant_(self.map_reg_branches[0][-1].bias.data[2:], 0.)
        if self.mot_decoder is not None:
            for p in self.mot_decoder.parameters():
                if p.dim() > 1:
                    nn.init.xavier_uniform_(p)
            nn.init.orthogonal_(self.mot_mode_query.weight)
        if self.mot_map_decoder is not None:
            for p in self.mot_map_decoder.parameters():
                if p.dim() > 1:
                    nn.init.xavier_uniform_(p)
            for p in self.lane_encoder.parameters():
                if p.dim() > 1:
                    nn.init.xavier_uniform_(p)
        if self.ego_pv_decoder is not None:
            for p in self.ego_pv_decoder.parameters():
                if p.dim() > 1:
                    nn.init.xavier_uniform_(p)
        if self.ego_agent_decoder is not None:
            for p in self.ego_agent_decoder.parameters():
                if p.dim() > 1:
                    nn.init.xavier_uniform_(p)
        if self.ego_map_decoder is not None:
            for p in self.ego_map_decoder.parameters():
                if p.dim() > 1:
                    nn.init.xavier_uniform_(p)
        if self.interaction_pe_type is not None:
            for emb_mlp in self.pe_embed_mlps:
                xavier_init(emb_mlp, distribution='uniform', bias=0.)
        # if self.cf_backbone is not None:
        #     load_checkpoint(self.cf_backbone, self.cf_backbone_ckpt, map_location='cpu')
Initialize weights of the DeformDETR head.
VADv2/VADv2_head.py