(*models)
| 14 | |
| 15 | |
| 16 | def initialize_weights(*models): |
| 17 | for model in models: |
| 18 | for module in model.modules(): |
| 19 | if isinstance(module, nn.Conv2d) or isinstance(module, nn.Linear): |
| 20 | nn.init.kaiming_normal(module.weight) |
| 21 | if module.bias is not None: |
| 22 | module.bias.data.zero_() |
| 23 | elif isinstance(module, nn.BatchNorm2d): |
| 24 | module.weight.data.fill_(1) |
| 25 | module.bias.data.zero_() |
| 26 | |
| 27 | |
| 28 | def get_upsampling_weight(in_channels, out_channels, kernel_size): |
nothing calls this directly
no outgoing calls
no test coverage detected