"vscode:/vscode.git/clone" did not exist on "e0ce190dfe6ead2fb2dfd4b2755af95177519fee"
Unverified Commit aef2b58a authored by Joao Gomes's avatar Joao Gomes Committed by GitHub
Browse files

updating mnasnet docs (#5920)



* updating mnasnet docs

* fix bug

* fix lint

* fix end of file

* fix linting

* Add missing weights
Co-authored-by: default avatarNicolas Hug <contact@nicolas-hug.com>
parent 65238ce0
MNASNet
=======
.. currentmodule:: torchvision.models
The MNASNet model is based on the `MnasNet: Platform-Aware Neural Architecture
Search for Mobile <https://arxiv.org/pdf/1807.11626.pdf>`__ paper.
Model builders
--------------
The following model builders can be used to instanciate an MNASNet model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.mnasnet.MNASNet`` base class. Please refer to the `source
code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mnasnet.py>`_ for
more details about this class.
.. autosummary::
:toctree: generated/
:template: function.rst
mnasnet0_5
mnasnet0_75
mnasnet1_0
mnasnet1_3
...@@ -43,6 +43,7 @@ weights: ...@@ -43,6 +43,7 @@ weights:
models/efficientnetv2 models/efficientnetv2
models/googlenet models/googlenet
models/inception models/inception
models/mnasnet
models/mobilenetv2 models/mobilenetv2
models/mobilenetv3 models/mobilenetv3
models/regnet models/regnet
......
...@@ -274,13 +274,25 @@ def _mnasnet(alpha: float, weights: Optional[WeightsEnum], progress: bool, **kwa ...@@ -274,13 +274,25 @@ def _mnasnet(alpha: float, weights: Optional[WeightsEnum], progress: bool, **kwa
@handle_legacy_interface(weights=("pretrained", MNASNet0_5_Weights.IMAGENET1K_V1)) @handle_legacy_interface(weights=("pretrained", MNASNet0_5_Weights.IMAGENET1K_V1))
def mnasnet0_5(*, weights: Optional[MNASNet0_5_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet: def mnasnet0_5(*, weights: Optional[MNASNet0_5_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet:
r"""MNASNet with depth multiplier of 0.5 from """MNASNet with depth multiplier of 0.5 from
`"MnasNet: Platform-Aware Neural Architecture Search for Mobile" `MnasNet: Platform-Aware Neural Architecture Search for Mobile
<https://arxiv.org/pdf/1807.11626.pdf>`_. <https://arxiv.org/pdf/1807.11626.pdf>`_ paper.
Args: Args:
weights (MNASNet0_5_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.MNASNet0_5_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr pretrained weights to use. See
:class:`~torchvision.models.MNASNet0_5_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.mnasnet.MNASNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mnasnet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.MNASNet0_5_Weights
:members:
""" """
weights = MNASNet0_5_Weights.verify(weights) weights = MNASNet0_5_Weights.verify(weights)
...@@ -289,13 +301,23 @@ def mnasnet0_5(*, weights: Optional[MNASNet0_5_Weights] = None, progress: bool = ...@@ -289,13 +301,23 @@ def mnasnet0_5(*, weights: Optional[MNASNet0_5_Weights] = None, progress: bool =
@handle_legacy_interface(weights=("pretrained", None)) @handle_legacy_interface(weights=("pretrained", None))
def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet: def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet:
r"""MNASNet with depth multiplier of 0.75 from """MNASNet with depth multiplier of 0.75 from
`"MnasNet: Platform-Aware Neural Architecture Search for Mobile" `MnasNet: Platform-Aware Neural Architecture Search for Mobile
<https://arxiv.org/pdf/1807.11626.pdf>`_. <https://arxiv.org/pdf/1807.11626.pdf>`_ paper.
Args: Args:
weights (MNASNet0_75_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.MNASNet0_75_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr pretrained weights to use. See
:class:`~torchvision.models.MNASNet0_75_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.mnasnet.MNASNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mnasnet.py>`_
for more details about this class.
""" """
weights = MNASNet0_75_Weights.verify(weights) weights = MNASNet0_75_Weights.verify(weights)
...@@ -304,13 +326,25 @@ def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool ...@@ -304,13 +326,25 @@ def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool
@handle_legacy_interface(weights=("pretrained", MNASNet1_0_Weights.IMAGENET1K_V1)) @handle_legacy_interface(weights=("pretrained", MNASNet1_0_Weights.IMAGENET1K_V1))
def mnasnet1_0(*, weights: Optional[MNASNet1_0_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet: def mnasnet1_0(*, weights: Optional[MNASNet1_0_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet:
r"""MNASNet with depth multiplier of 1.0 from """MNASNet with depth multiplier of 1.0 from
`"MnasNet: Platform-Aware Neural Architecture Search for Mobile" `MnasNet: Platform-Aware Neural Architecture Search for Mobile
<https://arxiv.org/pdf/1807.11626.pdf>`_. <https://arxiv.org/pdf/1807.11626.pdf>`_ paper.
Args: Args:
weights (MNASNet1_0_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.MNASNet1_0_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr pretrained weights to use. See
:class:`~torchvision.models.MNASNet1_0_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.mnasnet.MNASNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mnasnet.py>`_
for more details about this class.
.. autoclass:: torchvision.models.MNASNet1_0_Weights
:members:
""" """
weights = MNASNet1_0_Weights.verify(weights) weights = MNASNet1_0_Weights.verify(weights)
...@@ -319,13 +353,23 @@ def mnasnet1_0(*, weights: Optional[MNASNet1_0_Weights] = None, progress: bool = ...@@ -319,13 +353,23 @@ def mnasnet1_0(*, weights: Optional[MNASNet1_0_Weights] = None, progress: bool =
@handle_legacy_interface(weights=("pretrained", None)) @handle_legacy_interface(weights=("pretrained", None))
def mnasnet1_3(*, weights: Optional[MNASNet1_3_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet: def mnasnet1_3(*, weights: Optional[MNASNet1_3_Weights] = None, progress: bool = True, **kwargs: Any) -> MNASNet:
r"""MNASNet with depth multiplier of 1.3 from """MNASNet with depth multiplier of 1.3 from
`"MnasNet: Platform-Aware Neural Architecture Search for Mobile" `MnasNet: Platform-Aware Neural Architecture Search for Mobile
<https://arxiv.org/pdf/1807.11626.pdf>`_. <https://arxiv.org/pdf/1807.11626.pdf>`_ paper.
Args: Args:
weights (MNASNet1_3_Weights, optional): The pretrained weights for the model weights (:class:`~torchvision.models.MNASNet1_3_Weights`, optional): The
progress (bool): If True, displays a progress bar of the download to stderr pretrained weights to use. See
:class:`~torchvision.models.MNASNet1_3_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.mnasnet.MNASNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/mnasnet.py>`_
for more details about this class.
""" """
weights = MNASNet1_3_Weights.verify(weights) weights = MNASNet1_3_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