Skip to content

Commit f861003

Browse files
revamp docs for Wide ResNet (#5907)
* init * minor change * typo Co-authored-by: Nicolas Hug <[email protected]>
1 parent 2921174 commit f861003

File tree

4 files changed

+57
-9
lines changed

4 files changed

+57
-9
lines changed

docs/source/models/resnext.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ paper.
1010
Model builders
1111
--------------
1212

13-
The following model builders can be used to instantiate an ResNext model, with or
13+
The following model builders can be used to instantiate a ResNext model, with or
1414
without pre-trained weights. All the model builders internally rely on the
1515
``torchvision.models.resnet.ResNet`` base class. Please refer to the `source
1616
code

docs/source/models/wide_resnet.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Wide ResNet
2+
===========
3+
4+
.. currentmodule:: torchvision.models
5+
6+
The Wide ResNet model is based on the `Wide Residual Networks <https://arxiv.org/abs/1605.07146>`__
7+
paper.
8+
9+
10+
Model builders
11+
--------------
12+
13+
The following model builders can be used to instantiate a Wide ResNet model, with or
14+
without pre-trained weights. All the model builders internally rely on the
15+
``torchvision.models.resnet.ResNet`` base class. Please refer to the `source
16+
code
17+
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_ for
18+
more details about this class.
19+
20+
.. autosummary::
21+
:toctree: generated/
22+
:template: function.rst
23+
24+
wide_resnet50_2
25+
wide_resnet101_2

docs/source/models_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ weights:
5050
models/swin_transformer
5151
models/vgg
5252
models/vision_transformer
53+
models/wide_resnet
5354

5455

5556
Table of all available classification weights

torchvision/models/resnet.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -738,17 +738,28 @@ def resnext101_32x8d(
738738
def wide_resnet50_2(
739739
*, weights: Optional[Wide_ResNet50_2_Weights] = None, progress: bool = True, **kwargs: Any
740740
) -> ResNet:
741-
r"""Wide ResNet-50-2 model from
742-
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.
741+
"""Wide ResNet-50-2 model from
742+
`Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.
743743
744744
The model is the same as ResNet except for the bottleneck number of channels
745745
which is twice larger in every block. The number of channels in outer 1x1
746746
convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
747747
channels, and in Wide ResNet-50-2 has 2048-1024-2048.
748748
749749
Args:
750-
weights (Wide_ResNet50_2_Weights, optional): The pretrained weights for the model
751-
progress (bool): If True, displays a progress bar of the download to stderr
750+
weights (:class:`~torchvision.models.Wide_ResNet50_2_Weights`, optional): The
751+
pretrained weights to use. See
752+
:class:`~torchvision.models.Wide_ResNet50_2_Weights` below for
753+
more details, and possible values. By default, no pre-trained
754+
weights are used.
755+
progress (bool, optional): If True, displays a progress bar of the
756+
download to stderr. Default is True.
757+
**kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
758+
base class. Please refer to the `source code
759+
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
760+
for more details about this class.
761+
.. autoclass:: torchvision.models.Wide_ResNet50_2_Weights
762+
:members:
752763
"""
753764
weights = Wide_ResNet50_2_Weights.verify(weights)
754765

@@ -760,17 +771,28 @@ def wide_resnet50_2(
760771
def wide_resnet101_2(
761772
*, weights: Optional[Wide_ResNet101_2_Weights] = None, progress: bool = True, **kwargs: Any
762773
) -> ResNet:
763-
r"""Wide ResNet-101-2 model from
764-
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.
774+
"""Wide ResNet-101-2 model from
775+
`Wide Residual Networks <https://arxiv.org/abs/1605.07146>`_.
765776
766777
The model is the same as ResNet except for the bottleneck number of channels
767778
which is twice larger in every block. The number of channels in outer 1x1
768779
convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
769780
channels, and in Wide ResNet-50-2 has 2048-1024-2048.
770781
771782
Args:
772-
weights (Wide_ResNet101_2_Weights, optional): The pretrained weights for the model
773-
progress (bool): If True, displays a progress bar of the download to stderr
783+
weights (:class:`~torchvision.models.Wide_ResNet101_2_Weights`, optional): The
784+
pretrained weights to use. See
785+
:class:`~torchvision.models.Wide_ResNet101_2_Weights` below for
786+
more details, and possible values. By default, no pre-trained
787+
weights are used.
788+
progress (bool, optional): If True, displays a progress bar of the
789+
download to stderr. Default is True.
790+
**kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
791+
base class. Please refer to the `source code
792+
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
793+
for more details about this class.
794+
.. autoclass:: torchvision.models.Wide_ResNet101_2_Weights
795+
:members:
774796
"""
775797
weights = Wide_ResNet101_2_Weights.verify(weights)
776798

0 commit comments

Comments
 (0)