Skip to content

Commit a767cbf

Browse files
Yassine AlouiniNicolasHug
Yassine Alouini
andauthored
Revamp docs for Efficientnetv2 (#5864)
* [FEAT] Add efficientnetv2 doc. * [FIX] Precommits fix. * Apply suggestions from code review Co-authored-by: Nicolas Hug <[email protected]>
1 parent 9b44e99 commit a767cbf

File tree

3 files changed

+69
-9
lines changed

3 files changed

+69
-9
lines changed

docs/source/models/efficientnetv2.rst

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

docs/source/models_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ weights:
3737
:maxdepth: 1
3838

3939
models/efficientnet
40+
models/efficientnetv2
4041
models/regnet
4142
models/resnet
4243
models/squeezenet

torchvision/models/efficientnet.py

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -925,11 +925,22 @@ def efficientnet_v2_s(
925925
) -> EfficientNet:
926926
"""
927927
Constructs an EfficientNetV2-S architecture from
928-
`"EfficientNetV2: Smaller Models and Faster Training" <https://arxiv.org/abs/2104.00298>`_.
928+
`EfficientNetV2: Smaller Models and Faster Training <https://arxiv.org/abs/2104.00298>`_.
929929
930930
Args:
931-
weights (EfficientNet_V2_S_Weights, optional): The pretrained weights for the model
932-
progress (bool): If True, displays a progress bar of the download to stderr
931+
weights (:class:`~torchvision.models.EfficientNet_V2_S_Weights`, optional): The
932+
pretrained weights to use. See
933+
:class:`~torchvision.models.EfficientNet_V2_S_Weights` below for
934+
more details, and possible values. By default, no pre-trained
935+
weights are used.
936+
progress (bool, optional): If True, displays a progress bar of the
937+
download to stderr. Default is True.
938+
**kwargs: parameters passed to the ``torchvision.models.efficientnet.EfficientNet``
939+
base class. Please refer to the `source code
940+
<https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
941+
for more details about this class.
942+
.. autoclass:: torchvision.models.EfficientNet_V2_S_Weights
943+
:members:
933944
"""
934945
weights = EfficientNet_V2_S_Weights.verify(weights)
935946

@@ -951,11 +962,22 @@ def efficientnet_v2_m(
951962
) -> EfficientNet:
952963
"""
953964
Constructs an EfficientNetV2-M architecture from
954-
`"EfficientNetV2: Smaller Models and Faster Training" <https://arxiv.org/abs/2104.00298>`_.
965+
`EfficientNetV2: Smaller Models and Faster Training <https://arxiv.org/abs/2104.00298>`_.
955966
956967
Args:
957-
weights (EfficientNet_V2_M_Weights, optional): The pretrained weights for the model
958-
progress (bool): If True, displays a progress bar of the download to stderr
968+
weights (:class:`~torchvision.models.EfficientNet_V2_M_Weights`, optional): The
969+
pretrained weights to use. See
970+
:class:`~torchvision.models.EfficientNet_V2_M_Weights` below for
971+
more details, and possible values. By default, no pre-trained
972+
weights are used.
973+
progress (bool, optional): If True, displays a progress bar of the
974+
download to stderr. Default is True.
975+
**kwargs: parameters passed to the ``torchvision.models.efficientnet.EfficientNet``
976+
base class. Please refer to the `source code
977+
<https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
978+
for more details about this class.
979+
.. autoclass:: torchvision.models.EfficientNet_V2_M_Weights
980+
:members:
959981
"""
960982
weights = EfficientNet_V2_M_Weights.verify(weights)
961983

@@ -977,11 +999,22 @@ def efficientnet_v2_l(
977999
) -> EfficientNet:
9781000
"""
9791001
Constructs an EfficientNetV2-L architecture from
980-
`"EfficientNetV2: Smaller Models and Faster Training" <https://arxiv.org/abs/2104.00298>`_.
1002+
`EfficientNetV2: Smaller Models and Faster Training <https://arxiv.org/abs/2104.00298>`_.
9811003
9821004
Args:
983-
weights (EfficientNet_V2_L_Weights, optional): The pretrained weights for the model
984-
progress (bool): If True, displays a progress bar of the download to stderr
1005+
weights (:class:`~torchvision.models.EfficientNet_V2_L_Weights`, optional): The
1006+
pretrained weights to use. See
1007+
:class:`~torchvision.models.EfficientNet_V2_L_Weights` below for
1008+
more details, and possible values. By default, no pre-trained
1009+
weights are used.
1010+
progress (bool, optional): If True, displays a progress bar of the
1011+
download to stderr. Default is True.
1012+
**kwargs: parameters passed to the ``torchvision.models.efficientnet.EfficientNet``
1013+
base class. Please refer to the `source code
1014+
<https://github.com/pytorch/vision/blob/main/torchvision/models/efficientnet.py>`_
1015+
for more details about this class.
1016+
.. autoclass:: torchvision.models.EfficientNet_V2_L_Weights
1017+
:members:
9851018
"""
9861019
weights = EfficientNet_V2_L_Weights.verify(weights)
9871020

0 commit comments

Comments
 (0)