|
|
|
@@ -101,6 +101,7 @@ class ResNet(nn.Module): |
|
|
|
# Zero-initialize the last BN in each residual branch, |
|
|
|
# so that the residual branch starts with zeros, and each residual block behaves like an identity. |
|
|
|
# This improves the model by 0.2~0.3% according to https://arxiv.org/abs/1706.02677 |
|
|
|
#加入归一化层,对是否进行归一化进行判断 |
|
|
|
if zero_init_residual: |
|
|
|
for m in self.modules(): |
|
|
|
if isinstance(m, Bottleneck): |
|
|
|
|