Skip to content

Commit

Permalink
add comments for the modified implementation of ResNet (pytorch#1983)
Browse files Browse the repository at this point in the history
Co-authored-by: Charles Pao <dirtybluer@gmail.com>
  • Loading branch information
2 people authored and fmassa committed Jul 8, 2020
1 parent a645468 commit 11e6b54
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions torchvision/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ def forward(self, x):


class Bottleneck(nn.Module):
# Bottleneck in torchvision places the stride for downsampling at 3x3 convolution(self.conv2)
# while original implementation places the stride at the first 1x1 convolution(self.conv1)
# according to "Deep residual learning for image recognition"https://arxiv.org/abs/1512.03385.
# This variant is also known as ResNet V1.5 and improves accuracy according to
# https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch.

expansion = 4
__constants__ = ['downsample']

Expand Down

0 comments on commit 11e6b54

Please sign in to comment.