Unverified Commit 36c46357 authored by F-G Fernandez's avatar F-G Fernandez Committed by GitHub
Browse files

docs: Added MobileNetV2 to the new doc (#5899)



* docs: Added entry for MobileNet V2 in new doc

* docs: Updated MobileNetV2 docstring

* docs: Fixed docstring
Co-authored-by: default avatarFG Fernandez <–26927750+frgfm@users.noreply.github.com>
parent e288f6ca
MobileNet V2
============
.. currentmodule:: torchvision.models
The MobileNet V2 model is based on the `MobileNetV2: Inverted Residuals and Linear
Bottlenecks <https://arxiv.org/abs/1801.04381>`__ paper.
Model builders
--------------
The following model builders can be used to instantiate a MobileNetV2 model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.mobilenetv2.MobileNetV2`` base class. Please refer to the `source
code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mobilenetv2.py>`_ for
more details about this class.
.. autosummary::
:toctree: generated/
:template: function.rst
mobilenet_v2
...@@ -42,6 +42,7 @@ weights: ...@@ -42,6 +42,7 @@ weights:
models/efficientnet models/efficientnet
models/efficientnetv2 models/efficientnetv2
models/googlenet models/googlenet
models/mobilenetv2
models/regnet models/regnet
models/resnet models/resnet
models/resnext models/resnext
......
...@@ -233,13 +233,24 @@ class MobileNet_V2_Weights(WeightsEnum): ...@@ -233,13 +233,24 @@ class MobileNet_V2_Weights(WeightsEnum):
def mobilenet_v2( def mobilenet_v2(
*, weights: Optional[MobileNet_V2_Weights] = None, progress: bool = True, **kwargs: Any *, weights: Optional[MobileNet_V2_Weights] = None, progress: bool = True, **kwargs: Any
) -> MobileNetV2: ) -> MobileNetV2:
""" """MobileNetV2 architecture from the `MobileNetV2: Inverted Residuals and Linear
Constructs a MobileNetV2 architecture from Bottlenecks <https://arxiv.org/abs/1801.04381>`_ paper.
`"MobileNetV2: Inverted Residuals and Linear Bottlenecks" <https://arxiv.org/abs/1801.04381>`_.
Args: Args:
weights (MobileNet_V2_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.MobileNet_V2_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr pretrained weights to use. See
:class:`~torchvision.models.MobileNet_V2_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.mobilenetv2.MobileNetV2``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mobilenetv2.py>`_
for more details about this class.
.. autoclass:: torchvision.models.MobileNet_V2_Weights
:members:
""" """
weights = MobileNet_V2_Weights.verify(weights) weights = MobileNet_V2_Weights.verify(weights)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment