3333bab612229b68566a1643f7b22b44f5c4f739,mmcv/cnn/resnet.py,ResNet,init_weights,#ResNet#Any#,264

Before Change


        elif pretrained is None:
            for m in self.modules():
                if isinstance(m, nn.Conv2d):
                    n = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
                    nn.init.normal_(m.weight, 0, math.sqrt(2. / n))
                elif isinstance(m, nn.BatchNorm2d):
                    nn.init.constant_(m.weight, 1)

After Change


                if isinstance(m, nn.Conv2d):
                    kaiming_init(m)
                elif isinstance(m, nn.BatchNorm2d):
                    constant_init(m, 1)
        else:
            raise TypeError("pretrained must be a str or None")

    def forward(self, x):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: open-mmlab/mmcv
Commit Name: 3333bab612229b68566a1643f7b22b44f5c4f739
Time: 2018-10-09
Author: chenkaidev@gmail.com
File Name: mmcv/cnn/resnet.py
Class Name: ResNet
Method Name: init_weights


Project Name: open-mmlab/mmdetection
Commit Name: 0e747be830adbfb7aeb67d79871e116283971dbc
Time: 2018-10-10
Author: chenkaidev@gmail.com
File Name: mmdet/models/backbones/resnet.py
Class Name: ResNet
Method Name: init_weights


Project Name: open-mmlab/mmdetection
Commit Name: 574a920af36d0c4c1cce22d8c597d56ef48dee55
Time: 2019-01-02
Author: thangvubk@gmail.com
File Name: mmdet/models/backbones/resnet.py
Class Name: ResNet
Method Name: init_weights