Skip to content

Commit b1c84ce

Browse files
YosuaMichaelfacebook-github-bot
authored andcommitted
[fbsync] Add docs for SqueezeNet (#5832)
Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095645 fbshipit-source-id: c29748b860e5a1e15fa73d12ffb194edbf46fe06
1 parent 91606f0 commit b1c84ce

File tree

3 files changed

+60
-7
lines changed

3 files changed

+60
-7
lines changed

docs/source/models/squeezenet.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
SqueezeNet
2+
==========
3+
4+
.. currentmodule:: torchvision.models
5+
6+
The SqueezeNet model is based on the `SqueezeNet: AlexNet-level accuracy with
7+
50x fewer parameters and <0.5MB model size <https://arxiv.org/abs/1602.07360>`__
8+
paper.
9+
10+
11+
Model builders
12+
--------------
13+
14+
The following model builders can be used to instanciate a SqueezeNet model, with or
15+
without pre-trained weights. All the model builders internally rely on the
16+
``torchvision.models.squeezenet.SqueezeNet`` base class. Please refer to the `source
17+
code
18+
<https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>`_ for
19+
more details about this class.
20+
21+
.. autosummary::
22+
:toctree: generated/
23+
:template: function.rst
24+
25+
squeezenet1_0
26+
squeezenet1_1

docs/source/models_new.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ weights:
3737
:maxdepth: 1
3838

3939
models/resnet
40+
models/squeezenet
4041
models/vgg
4142

4243

torchvision/models/squeezenet.py

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,14 +159,27 @@ class SqueezeNet1_1_Weights(WeightsEnum):
159159
def squeezenet1_0(
160160
*, weights: Optional[SqueezeNet1_0_Weights] = None, progress: bool = True, **kwargs: Any
161161
) -> SqueezeNet:
162-
r"""SqueezeNet model architecture from the `"SqueezeNet: AlexNet-level
163-
accuracy with 50x fewer parameters and <0.5MB model size"
162+
"""SqueezeNet model architecture from the `SqueezeNet: AlexNet-level
163+
accuracy with 50x fewer parameters and <0.5MB model size
164164
<https://arxiv.org/abs/1602.07360>`_ paper.
165+
165166
The required minimum input size of the model is 21x21.
166167
167168
Args:
168-
weights (SqueezeNet1_0_Weights, optional): The pretrained weights for the model
169-
progress (bool): If True, displays a progress bar of the download to stderr
169+
weights (:class:`~torchvision.models.SqueezeNet1_0_Weights`, optional): The
170+
pretrained weights to use. See
171+
:class:`~torchvision.models.SqueezeNet1_0_Weights` below for
172+
more details, and possible values. By default, no pre-trained
173+
weights are used.
174+
progress (bool, optional): If True, displays a progress bar of the
175+
download to stderr. Default is True.
176+
**kwargs: parameters passed to the ``torchvision.models.squeezenet.SqueezeNet``
177+
base class. Please refer to the `source code
178+
<https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>`_
179+
for more details about this class.
180+
181+
.. autoclass:: torchvision.models.SqueezeNet1_0_Weights
182+
:members:
170183
"""
171184
weights = SqueezeNet1_0_Weights.verify(weights)
172185
return _squeezenet("1_0", weights, progress, **kwargs)
@@ -176,15 +189,28 @@ def squeezenet1_0(
176189
def squeezenet1_1(
177190
*, weights: Optional[SqueezeNet1_1_Weights] = None, progress: bool = True, **kwargs: Any
178191
) -> SqueezeNet:
179-
r"""SqueezeNet 1.1 model from the `official SqueezeNet repo
192+
"""SqueezeNet 1.1 model from the `official SqueezeNet repo
180193
<https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>`_.
194+
181195
SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters
182196
than SqueezeNet 1.0, without sacrificing accuracy.
183197
The required minimum input size of the model is 17x17.
184198
185199
Args:
186-
weights (SqueezeNet1_1_Weights, optional): The pretrained weights for the model
187-
progress (bool): If True, displays a progress bar of the download to stderr
200+
weights (:class:`~torchvision.models.SqueezeNet1_1_Weights`, optional): The
201+
pretrained weights to use. See
202+
:class:`~torchvision.models.SqueezeNet1_1_Weights` below for
203+
more details, and possible values. By default, no pre-trained
204+
weights are used.
205+
progress (bool, optional): If True, displays a progress bar of the
206+
download to stderr. Default is True.
207+
**kwargs: parameters passed to the ``torchvision.models.squeezenet.SqueezeNet``
208+
base class. Please refer to the `source code
209+
<https://github.com/pytorch/vision/blob/main/torchvision/models/squeezenet.py>`_
210+
for more details about this class.
211+
212+
.. autoclass:: torchvision.models.SqueezeNet1_1_Weights
213+
:members:
188214
"""
189215
weights = SqueezeNet1_1_Weights.verify(weights)
190216
return _squeezenet("1_1", weights, progress, **kwargs)

0 commit comments

Comments
 (0)