(self)
| 672 | return nn.Sequential(*modules), num_inchannels |
| 673 | |
| 674 | def init_weights(self): |
| 675 | for m in self.modules(): |
| 676 | if isinstance(m, nn.Conv2d): |
| 677 | nn.init.kaiming_normal_( |
| 678 | m.weight, mode='fan_out', nonlinearity='relu') |
| 679 | elif isinstance(m, nn.BatchNorm2d): |
| 680 | nn.init.constant_(m.weight, 1) |
| 681 | nn.init.constant_(m.bias, 0) |
| 682 | |
| 683 | def get_classifier(self): |
| 684 | return self.classifier |