Skip to content

Add inception docs #5924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ ConvNeXt
convnext_large

SwinTransformer
--------
---------------
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small bug


.. autosummary::
:toctree: generated/
Expand Down
23 changes: 23 additions & 0 deletions docs/source/models/inception.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Inception V3
============

.. currentmodule:: torchvision.models

The EfficientNet model is based on the `Rethinking the Inception Architecture for Computer Vision <https://arxiv.org/abs/1512.00567>`__
paper.


Model builders
--------------

The following model builders can be used to instanciate an InceptionV3 model, with or
without pre-trained weights. All the model builders internally rely on the
``torchvision.models.efficientnet.Inception3`` base class. Please refer to the `source
code <https://github.com/pytorch/vision/blob/main/torchvision/models/inception.py>`_ for
more details about this class.

.. autosummary::
:toctree: generated/
:template: function.rst

inception_v3
1 change: 1 addition & 0 deletions docs/source/models_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ weights:
models/efficientnet
models/efficientnetv2
models/googlenet
models/inception
models/mobilenetv2
models/mobilenetv3
models/regnet
Expand Down
2 changes: 1 addition & 1 deletion torchvision/models/googlenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def googlenet(*, weights: Optional[GoogLeNet_Weights] = None, progress: bool = T
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.squeezenet.GoogLeNet``
**kwargs: parameters passed to the ``torchvision.models.GoogLeNet``
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small bug spotted

base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/googlenet.py>`_
for more details about this class.
Expand Down
25 changes: 17 additions & 8 deletions torchvision/models/inception.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,21 +427,30 @@ class Inception_V3_Weights(WeightsEnum):

@handle_legacy_interface(weights=("pretrained", Inception_V3_Weights.IMAGENET1K_V1))
def inception_v3(*, weights: Optional[Inception_V3_Weights] = None, progress: bool = True, **kwargs: Any) -> Inception3:
r"""Inception v3 model architecture from
`"Rethinking the Inception Architecture for Computer Vision" <http://arxiv.org/abs/1512.00567>`_.
"""
Inception v3 model architecture from
`Rethinking the Inception Architecture for Computer Vision <http://arxiv.org/abs/1512.00567>`_.
The required minimum input size of the model is 75x75.

.. note::
**Important**: In contrast to the other models the inception_v3 expects tensors with a size of
N x 3 x 299 x 299, so ensure your images are sized accordingly.

Args:
weights (Inception_V3_Weights, optional): The pretrained weights for the model
progress (bool): If True, displays a progress bar of the download to stderr
aux_logits (bool): If True, add an auxiliary branch that can improve training.
Default: *True*
transform_input (bool): If True, preprocesses the input according to the method with which it
was trained on ImageNet. Default: True if ``weights=Inception_V3_Weights.IMAGENET1K_V1``, else False.
weights (:class:`~torchvision.models.Inception_V3_Weights`, optional): The
pretrained weights for the model. See
:class:`~torchvision.models.Inception_V3_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.Inception3``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/inception.py>`_
for more details about this class.

.. autoclass:: torchvision.models.Inception_V3_Weights
:members:
"""
weights = Inception_V3_Weights.verify(weights)

Expand Down