"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "8ae8008b0d096d2b093f5b7c660715a93f74f17a"
Unverified Commit 37665a0b authored by puhuk's avatar puhuk Committed by GitHub
Browse files

Document ResNet architecture tweak (#5977)



* 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
Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent d57f929d
...@@ -6,6 +6,11 @@ ResNet ...@@ -6,6 +6,11 @@ ResNet
The ResNet model is based on the `Deep Residual Learning for Image Recognition The ResNet model is based on the `Deep Residual Learning for Image Recognition
<https://arxiv.org/abs/1512.03385>`_ paper. <https://arxiv.org/abs/1512.03385>`_ paper.
.. note::
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
convolution while the original paper places it to the first 1x1 convolution.
This variant improves the accuracy and is known as `ResNet V1.5
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
Model builders Model builders
-------------- --------------
......
...@@ -699,6 +699,12 @@ def resnet34(*, weights: Optional[ResNet34_Weights] = None, progress: bool = Tru ...@@ -699,6 +699,12 @@ def resnet34(*, weights: Optional[ResNet34_Weights] = None, progress: bool = Tru
def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet: def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
"""ResNet-50 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__. """ResNet-50 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
.. note::
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
convolution while the original paper places it to the first 1x1 convolution.
This variant improves the accuracy and is known as `ResNet V1.5
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
Args: Args:
weights (:class:`~torchvision.models.ResNet50_Weights`, optional): The weights (:class:`~torchvision.models.ResNet50_Weights`, optional): The
pretrained weights to use. See pretrained weights to use. See
...@@ -724,6 +730,12 @@ def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = Tru ...@@ -724,6 +730,12 @@ def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = Tru
def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet: def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
"""ResNet-101 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__. """ResNet-101 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
.. note::
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
convolution while the original paper places it to the first 1x1 convolution.
This variant improves the accuracy and is known as `ResNet V1.5
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
Args: Args:
weights (:class:`~torchvision.models.ResNet101_Weights`, optional): The weights (:class:`~torchvision.models.ResNet101_Weights`, optional): The
pretrained weights to use. See pretrained weights to use. See
...@@ -749,6 +761,12 @@ def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = T ...@@ -749,6 +761,12 @@ def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = T
def resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet: def resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet:
"""ResNet-152 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__. """ResNet-152 from `Deep Residual Learning for Image Recognition <https://arxiv.org/pdf/1512.03385.pdf>`__.
.. note::
The bottleneck of TorchVision places the stride for downsampling to the second 3x3
convolution while the original paper places it to the first 1x1 convolution.
This variant improves the accuracy and is known as `ResNet V1.5
<https://ngc.nvidia.com/catalog/model-scripts/nvidia:resnet_50_v1_5_for_pytorch>`_.
Args: Args:
weights (:class:`~torchvision.models.ResNet152_Weights`, optional): The weights (:class:`~torchvision.models.ResNet152_Weights`, optional): The
pretrained weights to use. See pretrained weights to use. See
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment