def reset_parameters()

in seamseg/modules/heads/fpn.py [0:0]


    def reset_parameters(self):
        gain = nn.init.calculate_gain(self.output[0].bn1.activation, self.output[0].bn1.activation_param)
        for name, mod in self.named_modules():
            if isinstance(mod, nn.Conv2d):
                if "conv_sem" not in name:
                    nn.init.xavier_normal_(mod.weight, gain)
                else:
                    nn.init.xavier_normal_(mod.weight, .1)
            elif isinstance(mod, ABN):
                nn.init.constant_(mod.weight, 1.)
            if hasattr(mod, "bias") and mod.bias is not None:
                nn.init.constant_(mod.bias, 0.)