Skip to content

Commit 703f2b9

Browse files
Add revamped docs for ResNeXt (#5871)
* initial commit * formatting * minor change * replaced pdf link with webpage link * replaced pdf link with webpage link * minor * minor Co-authored-by: Nicolas Hug <[email protected]>
1 parent f196782 commit 703f2b9

File tree

3 files changed

+56
-8
lines changed

3 files changed

+56
-8
lines changed

docs/source/models/resnext.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ResNeXt
2+
=======
3+
4+
.. currentmodule:: torchvision.models
5+
6+
The ResNext model is based on the `Aggregated Residual Transformations for Deep Neural Networks <https://arxiv.org/abs/1611.05431v2>`__
7+
paper.
8+
9+
10+
Model builders
11+
--------------
12+
13+
The following model builders can be used to instantiate an ResNext 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+
resnext50_32x4d
25+
resnext101_32x8d

docs/source/models_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ weights:
4141
models/efficientnetv2
4242
models/regnet
4343
models/resnet
44+
models/resnext
4445
models/squeezenet
4546
models/vgg
4647
models/vision_transformer

torchvision/models/resnet.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -680,12 +680,23 @@ def resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = T
680680
def resnext50_32x4d(
681681
*, weights: Optional[ResNeXt50_32X4D_Weights] = None, progress: bool = True, **kwargs: Any
682682
) -> ResNet:
683-
r"""ResNeXt-50 32x4d model from
684-
`"Aggregated Residual Transformation for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_.
683+
"""ResNeXt-50 32x4d model from
684+
`Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.
685685
686686
Args:
687-
weights (ResNeXt50_32X4D_Weights, optional): The pretrained weights for the model
688-
progress (bool): If True, displays a progress bar of the download to stderr
687+
weights (:class:`~torchvision.models.ResNeXt50_32X4D_Weights`, optional): The
688+
pretrained weights to use. See
689+
:class:`~torchvision.models.ResNext50_32X4D_Weights` below for
690+
more details, and possible values. By default, no pre-trained
691+
weights are used.
692+
progress (bool, optional): If True, displays a progress bar of the
693+
download to stderr. Default is True.
694+
**kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
695+
base class. Please refer to the `source code
696+
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
697+
for more details about this class.
698+
.. autoclass:: torchvision.models.ResNeXt50_32X4D_Weights
699+
:members:
689700
"""
690701
weights = ResNeXt50_32X4D_Weights.verify(weights)
691702

@@ -698,12 +709,23 @@ def resnext50_32x4d(
698709
def resnext101_32x8d(
699710
*, weights: Optional[ResNeXt101_32X8D_Weights] = None, progress: bool = True, **kwargs: Any
700711
) -> ResNet:
701-
r"""ResNeXt-101 32x8d model from
702-
`"Aggregated Residual Transformation for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_.
712+
"""ResNeXt-101 32x8d model from
713+
`Aggregated Residual Transformation for Deep Neural Networks <https://arxiv.org/abs/1611.05431>`_.
703714
704715
Args:
705-
weights (ResNeXt101_32X8D_Weights, optional): The pretrained weights for the model
706-
progress (bool): If True, displays a progress bar of the download to stderr
716+
weights (:class:`~torchvision.models.ResNeXt101_32X8D_Weights`, optional): The
717+
pretrained weights to use. See
718+
:class:`~torchvision.models.ResNeXt101_32X8D_Weights` below for
719+
more details, and possible values. By default, no pre-trained
720+
weights are used.
721+
progress (bool, optional): If True, displays a progress bar of the
722+
download to stderr. Default is True.
723+
**kwargs: parameters passed to the ``torchvision.models.resnet.ResNet``
724+
base class. Please refer to the `source code
725+
<https://github.com/pytorch/vision/blob/main/torchvision/models/resnet.py>`_
726+
for more details about this class.
727+
.. autoclass:: torchvision.models.ResNeXt101_32X8D_Weights
728+
:members:
707729
"""
708730
weights = ResNeXt101_32X8D_Weights.verify(weights)
709731

0 commit comments

Comments
 (0)