Skip to content

Commit b0e78aa

Browse files
YosuaMichaeldatumbox
authored andcommitted
[fbsync] Document ResNet architecture tweak (#5977)
Summary: * To resolve issue #5964 Add note for resnet architecture * Update resnet.py * Update resnet.py * Update resnet.rst * Fix stylings * Add the same notes on model builders * Improve description * Apply the change everywhere * Remove trailing space Reviewed By: NicolasHug Differential Revision: D36760934 fbshipit-source-id: 044ff1d1f35f6354dbc7608a0d30951aa90190a2 Co-authored-by: Vasilis Vryniotis <[email protected]>
1 parent 7c7c118 commit b0e78aa

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/source/models/resnet.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ ResNet
66
The ResNet model is based on the `Deep Residual Learning for Image Recognition
77
<https://arxiv.org/abs/1512.03385>`_ paper.
88

9+
.. note::
10+
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
11+
convolution while the original paper places it to the first 1x1 convolution.
12+
This variant improves the accuracy and is known as `ResNet V1.5
13+
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
914

1015
Model builders
1116
--------------

torchvision/models/resnet.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,12 @@ def resnet34(*, weights: Optional[ResNet34_Weights] = None, progress: bool = Tru
699699
def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
700700
"""ResNet-50 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
701701
702+
.. note::
703+
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
704+
convolution while the original paper places it to the first 1x1 convolution.
705+
This variant improves the accuracy and is known as `ResNet V1.5
706+
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
707+
702708
Args:
703709
weights (:class:`~torchvision.models.ResNet50_Weights`, optional): The
704710
pretrained weights to use. See
@@ -724,6 +730,12 @@ def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = Tru
724730
def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
725731
"""ResNet-101 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
726732
733+
.. note::
734+
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
735+
convolution while the original paper places it to the first 1x1 convolution.
736+
This variant improves the accuracy and is known as `ResNet V1.5
737+
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
738+
727739
Args:
728740
weights (:class:`~torchvision.models.ResNet101_Weights`, optional): The
729741
pretrained weights to use. See
@@ -749,6 +761,12 @@ def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = T
749761
def resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
750762
"""ResNet-152 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
751763
764+
.. note::
765+
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
766+
convolution while the original paper places it to the first 1x1 convolution.
767+
This variant improves the accuracy and is known as `ResNet V1.5
768+
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
769+
752770
Args:
753771
weights (:class:`~torchvision.models.ResNet152_Weights`, optional): The
754772
pretrained weights to use. See

0 commit comments

Comments
 (0)