def init_weights(self):
        """Initialize weights of the PETR 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:
                constant_(m.bias, bias_init)
        for m in self.kpt_branches:
            constant_(m[-1].bias, 0)
        # initialization of keypoint refinement branch
        if self.with_kpt_refine:
            for m in self.refine_kpt_branches:
                constant_(m[-1].bias, 0)
        # initialize bias for heatmap prediction
        bias_init = bias_init_with_prob(0.1)
        normal_(self.fc_hm.weight, std=0.01)
        constant_(self.fc_hm.bias, bias_init)
Initialize weights of the PETR head.
ppdet/modeling/heads/petr_head.py