From f9c1eabcc83316aa11f68852e0336410fdbf12cf Mon Sep 17 00:00:00 2001 From: Yassine Alouini Date: Tue, 26 Apr 2022 16:32:37 +0200 Subject: [PATCH] [DOC] Add new googlenet documenation. --- docs/source/models/googlenet.rst | 24 ++++++++++++++++++++++++ docs/source/models_new.rst | 1 + torchvision/models/googlenet.py | 21 ++++++++++++++------- 3 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 docs/source/models/googlenet.rst diff --git a/docs/source/models/googlenet.rst b/docs/source/models/googlenet.rst new file mode 100644 index 00000000000..ed4f1345e23 --- /dev/null +++ b/docs/source/models/googlenet.rst @@ -0,0 +1,24 @@ +GoogLeNet +========= + +.. currentmodule:: torchvision.models + +The GoogleNet model is based on the `Going Deeper with Convolutions `__ +paper. + + +Model builders +-------------- + +The following model builders can be used to instanciate a GoogLeNet model, with or +without pre-trained weights. All the model builders internally rely on the +``torchvision.models.googlenet.GoogLeNet`` base class. Please refer to the `source +code +`_ for +more details about this class. + +.. autosummary:: + :toctree: generated/ + :template: function.rst + + googlenet diff --git a/docs/source/models_new.rst b/docs/source/models_new.rst index 95f5915dd9a..538acce4d1c 100644 --- a/docs/source/models_new.rst +++ b/docs/source/models_new.rst @@ -40,6 +40,7 @@ weights: models/densenet models/efficientnet models/efficientnetv2 + models/googlenet models/regnet models/resnet models/resnext diff --git a/torchvision/models/googlenet.py b/torchvision/models/googlenet.py index 94ce3c99b47..cb65306b9fd 100644 --- a/torchvision/models/googlenet.py +++ b/torchvision/models/googlenet.py @@ -296,16 +296,23 @@ class GoogLeNet_Weights(WeightsEnum): @handle_legacy_interface(weights=("pretrained", GoogLeNet_Weights.IMAGENET1K_V1)) def googlenet(*, weights: Optional[GoogLeNet_Weights] = None, progress: bool = True, **kwargs: Any) -> GoogLeNet: r"""GoogLeNet (Inception v1) model architecture from - `"Going Deeper with Convolutions" `_. + `Going Deeper with Convolutions `_. The required minimum input size of the model is 15x15. Args: - weights (GoogLeNet_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, adds two auxiliary branches that can improve training. - Default: *False* when pretrained is True otherwise *True* - transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: True if ``weights=GoogLeNet_Weights.IMAGENET1K_V1``, else False. + weights (:class:`~torchvision.models.GoogLeNet_Weights`, optional): The + pretrained weights for the model. See + :class:`~torchvision.models.GoogLeNet_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.squeezenet.GoogLeNet`` + base class. Please refer to the `source code + `_ + for more details about this class. + .. autoclass:: torchvision.models.GoogLeNet_Weights + :members: """ weights = GoogLeNet_Weights.verify(weights)