(feature, conv_init, norm_layer, bn_eps, bn_momentum, **kwargs)
| 5 | |
| 6 | |
| 7 | def __init_weight(feature, conv_init, norm_layer, bn_eps, bn_momentum, **kwargs): |
| 8 | for name, m in feature.named_modules(): |
| 9 | if isinstance(m, (nn.Conv1d, nn.Conv2d, nn.Conv3d)): |
| 10 | conv_init(m.weight, **kwargs) |
| 11 | elif isinstance(m, norm_layer): |
| 12 | m.eps = bn_eps |
| 13 | m.momentum = bn_momentum |
| 14 | nn.init.constant_(m.weight, 1) |
| 15 | nn.init.constant_(m.bias, 0) |
| 16 | |
| 17 | |
| 18 | def init_weight(module_list, conv_init, norm_layer, bn_eps, bn_momentum, **kwargs): |