Skip to content

Commit b370d59

Browse files
YosuaMichaelNicolasHug
authored andcommitted
[fbsync] AlexNet New Documentation. (#5886)
Summary: * [DOC] Add alexnet new documentation. * [FIX] Fix wrong alexnet header. * [FIX] Fix the AlexNet paper link. Reviewed By: jdsgomes, NicolasHug Differential Revision: D36095661 fbshipit-source-id: ac3114c7d7d975e4bd01078b90253107fa9a4bc4 Co-authored-by: Nicolas Hug <[email protected]>
1 parent 5a12ef1 commit b370d59

File tree

4 files changed

+47
-7
lines changed

4 files changed

+47
-7
lines changed

docs/source/models/alexnet.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
AlexNet
2+
=======
3+
4+
.. currentmodule:: torchvision.models
5+
6+
The AlexNet model is based on the `ImageNet Classification with Deep Convolutional Neural Networks
7+
<https://papers.nips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html>`__
8+
paper.
9+
10+
11+
Model builders
12+
--------------
13+
14+
The following model builders can be used to instanciate an AlexNet model, with or
15+
without pre-trained weights. All the model builders internally rely on the
16+
``torchvision.models.alexnet.AlexNet`` base class. Please refer to the `source
17+
code
18+
<https://github.com/pytorch/vision/blob/main/torchvision/models/alexnet.py>`_ for
19+
more details about this class.
20+
21+
.. autosummary::
22+
:toctree: generated/
23+
:template: function.rst
24+
25+
alexnet

docs/source/models/efficientnetv2.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
EfficientNetV2
2-
============
2+
==============
33

44
.. currentmodule:: torchvision.models
55

docs/source/models_new.rst

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

39+
models/alexnet
3940
models/convnext
4041
models/densenet
4142
models/efficientnet

torchvision/models/alexnet.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,27 @@ class AlexNet_Weights(WeightsEnum):
7373
@handle_legacy_interface(weights=("pretrained", AlexNet_Weights.IMAGENET1K_V1))
7474
def alexnet(*, weights: Optional[AlexNet_Weights] = None, progress: bool = True, **kwargs: Any) -> AlexNet:
7575
r"""AlexNet model architecture from the
76-
`"One weird trick..." <https://arxiv.org/abs/1404.5997>`_ paper.
77-
The required minimum input size of the model is 63x63.
78-
79-
Args:
80-
weights (AlexNet_Weights, optional): The pretrained weights for the model
81-
progress (bool): If True, displays a progress bar of the download to stderr
76+
`ImageNet Classification with Deep Convolutional Neural Networks
77+
<https://papers.nips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html>`_ paper.
78+
The required minimum input size of the model is 63x63.
79+
80+
Args:
81+
weights (:class:`~torchvision.models.AlexNet_Weights`, optional): The
82+
pretrained weights to use. See
83+
:class:`~torchvision.models.AlexNet_Weights` below for
84+
more details, and possible values. By default, no pre-trained
85+
weights are used.
86+
progress (bool, optional): If True, displays a progress bar of the
87+
download to stderr. Default is True.
88+
**kwargs: parameters passed to the ``torchvision.models.squeezenet.AlexNet``
89+
base class. Please refer to the `source code
90+
<https://github.com/pytorch/vision/blob/main/torchvision/models/alexnet.py>`_
91+
for more details about this class.
92+
93+
.. autoclass:: torchvision.models.AlexNet_Weights
94+
:members:
8295
"""
96+
8397
weights = AlexNet_Weights.verify(weights)
8498

8599
if weights is not None:

0 commit comments

Comments
 (0)