Browse Source

Update model_define.py

main
Ezpgkx9o7 4 years ago
parent
commit
44cced0ebe
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      model_define.py

+ 1
- 0
model_define.py View File

@@ -101,6 +101,7 @@ class ResNet(nn.Module):
# Zero-initialize the last BN in each residual branch, # 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. # 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 # This improves the model by 0.2~0.3% according to https://arxiv.org/abs/1706.02677
#加入归一化层,对是否进行归一化进行判断
if zero_init_residual: if zero_init_residual:
for m in self.modules(): for m in self.modules():
if isinstance(m, Bottleneck): if isinstance(m, Bottleneck):


Loading…
Cancel
Save