Skip to content

revamp docs for Wide ResNet #5907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/models/resnext.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ paper.
Model builders
--------------

The following model builders can be used to instantiate an ResNext model, with or
The following model builders can be used to instantiate a ResNext model, with or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

without pre-trained weights. All the model builders internally rely on the
``torchvision.models.resnet.ResNet`` base class. Please refer to the `source
code
Expand Down
25 changes: 25 additions & 0 deletions docs/source/models/wide_resnet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Wide ResNet
===========

.. currentmodule:: torchvision.models

The Wide ResNet model is based on the `Wide Residual Networks <https://arxiv.org/abs/1605.07146>`__
paper.


Model builders
--------------

The following model builders can be used to instantiate a Wide ResNet model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.resnet.ResNet`` base class. Please refer to the `source
code
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_ for
more details about this class.

.. autosummary::
:toctree: generated/
:template: function.rst

wide_resnet50_2
wide_resnet101_2
1 change: 1 addition & 0 deletions docs/source/models_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ weights:
models/swin_transformer
models/vgg
models/vision_transformer
models/wide_resnet


Table of all available classification weights
Expand Down
38 changes: 30 additions & 8 deletions torchvision/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -738,17 +738,28 @@ def resnext101_32x8d(
def wide_resnet50_2(
*, weights: Optional[Wide_ResNet50_2_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
r"""Wide ResNet-50-2 model from
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.
"""Wide ResNet-50-2 model from
`Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.

The model is the same as ResNet except for the bottleneck number of channels
which is twice larger in every block. The number of channels in outer 1x1
convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
channels, and in Wide ResNet-50-2 has 2048-1024-2048.

Args:
weights (Wide_ResNet50_2_Weights, optional): The pretrained weights for the model
progress (bool): If True, displays a progress bar of the download to stderr
weights (:class:`~torchvision.models.Wide_ResNet50_2_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.Wide_ResNet50_2_Weights` below for
more details, and possible values. By default, no pre-trained
weights are used.
progress (bool, optional): If True, displays a progress bar of the
download to stderr. Default is True.
**kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.Wide_ResNet50_2_Weights
:members:
"""
weights = Wide_ResNet50_2_Weights.verify(weights)

Expand All @@ -760,17 +771,28 @@ def wide_resnet50_2(
def wide_resnet101_2(
*, weights: Optional[Wide_ResNet101_2_Weights] = None, progress: bool = True, **kwargs: Any
) -> ResNet:
r"""Wide ResNet-101-2 model from
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.
"""Wide ResNet-101-2 model from
`Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.

The model is the same as ResNet except for the bottleneck number of channels
which is twice larger in every block. The number of channels in outer 1x1
convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
channels, and in Wide ResNet-50-2 has 2048-1024-2048.

Args:
weights (Wide_ResNet101_2_Weights, optional): The pretrained weights for the model
progress (bool): If True, displays a progress bar of the download to stderr
weights (:class:`~torchvision.models.Wide_ResNet101_2_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.Wide_ResNet101_2_Weights` below for
more details, and possible values. By default, no pre-trained
weights are used.
progress (bool, optional): If True, displays a progress bar of the
download to stderr. Default is True.
**kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.Wide_ResNet101_2_Weights
:members:
"""
weights = Wide_ResNet101_2_Weights.verify(weights)

Expand Down