Esempio n. 1
0
    def init_weights(self):
        for module_list in [
                self.reg_cls_fcs, self.reg_offset_fcs, self.cls_fcs
        ]:
            for m in module_list.modules():
                if isinstance(m, nn.Linear):
                    xavier_init(m, distribution='uniform')
        if self.reg_feat_up_ratio > 1:
            kaiming_init(self.upsample_x, distribution='normal')
            kaiming_init(self.upsample_y, distribution='normal')

        normal_init(self.reg_conv_att_x, 0, 0.01)
        normal_init(self.reg_conv_att_y, 0, 0.01)
        normal_init(self.fc_reg_offset, 0, 0.001)
        normal_init(self.fc_reg_cls, 0, 0.01)
        normal_init(self.fc_cls, 0, 0.01)
Esempio n. 2
0
 def init_weights(self):
     """Initialize weights of the head."""
     for m in self.modules():
         if isinstance(m, nn.Conv2d):
             xavier_init(m, distribution='uniform', bias=0)