Skip to content

Commit 58c92a3

Browse files
YosuaMichaelNicolasHug
authored andcommitted
[fbsync] Add revamped docs for Mobilenetv3 (#5908)
Summary: * Start adding * Finish adding docs * Fix other bugs * Update torchvision/models/mobilenetv3.py * Update torchvision/models/mobilenetv3.py Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095706 fbshipit-source-id: 4cacadb85cf008687246622e6c0d6a9380ef9ebe Co-authored-by: Nicolas Hug <[email protected]>
1 parent 6b7d0b9 commit 58c92a3

File tree

4 files changed

+56
-7
lines changed

4 files changed

+56
-7
lines changed

docs/source/models/convnext.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ConvNeXt
2-
======
2+
========
33

44
.. currentmodule:: torchvision.models
55

docs/source/models/mobilenetv3.rst

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

docs/source/models_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ weights:
4343
models/efficientnetv2
4444
models/googlenet
4545
models/mobilenetv2
46+
models/mobilenetv3
4647
models/regnet
4748
models/resnet
4849
models/resnext

torchvision/models/mobilenetv3.py

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,23 @@ def mobilenet_v3_large(
362362
) -> MobileNetV3:
363363
"""
364364
Constructs a large MobileNetV3 architecture from
365-
`"Searching for MobileNetV3" <https://arxiv.org/abs/1905.02244>`_.
365+
`Searching for MobileNetV3 <https://arxiv.org/abs/1905.02244>`__.
366366
367367
Args:
368-
weights (MobileNet_V3_Large_Weights, optional): The pretrained weights for the model
369-
progress (bool): If True, displays a progress bar of the download to stderr
368+
weights (:class:`~torchvision.models.MobileNet_V3_Large_Weights`, optional): The
369+
pretrained weights to use. See
370+
:class:`~torchvision.models.MobileNet_V3_Large_Weights` below for
371+
more details, and possible values. By default, no pre-trained
372+
weights are used.
373+
progress (bool, optional): If True, displays a progress bar of the
374+
download to stderr. Default is True.
375+
**kwargs: parameters passed to the ``torchvision.models.resnet.MobileNetV3``
376+
base class. Please refer to the `source code
377+
<https://github.com/pytorch/vision/blob/main/torchvision/models/mobilenetv3.py>`_
378+
for more details about this class.
379+
380+
.. autoclass:: torchvision.models.MobileNet_V3_Large_Weights
381+
:members:
370382
"""
371383
weights = MobileNet_V3_Large_Weights.verify(weights)
372384

@@ -380,11 +392,23 @@ def mobilenet_v3_small(
380392
) -> MobileNetV3:
381393
"""
382394
Constructs a small MobileNetV3 architecture from
383-
`"Searching for MobileNetV3" <https://arxiv.org/abs/1905.02244>`_.
395+
`Searching for MobileNetV3 <https://arxiv.org/abs/1905.02244>`__.
384396
385397
Args:
386-
weights (MobileNet_V3_Small_Weights, optional): The pretrained weights for the model
387-
progress (bool): If True, displays a progress bar of the download to stderr
398+
weights (:class:`~torchvision.models.MobileNet_V3_Small_Weights`, optional): The
399+
pretrained weights to use. See
400+
:class:`~torchvision.models.MobileNet_V3_Small_Weights` below for
401+
more details, and possible values. By default, no pre-trained
402+
weights are used.
403+
progress (bool, optional): If True, displays a progress bar of the
404+
download to stderr. Default is True.
405+
**kwargs: parameters passed to the ``torchvision.models.resnet.MobileNetV3``
406+
base class. Please refer to the `source code
407+
<https://github.com/pytorch/vision/blob/main/torchvision/models/mobilenetv3.py>`_
408+
for more details about this class.
409+
410+
.. autoclass:: torchvision.models.MobileNet_V3_Small_Weights
411+
:members:
388412
"""
389413
weights = MobileNet_V3_Small_Weights.verify(weights)
390414

0 commit comments

Comments
 (0)