Skip to content
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
25 changes: 25 additions & 0 deletions docs/source/models/alexnet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
AlexNet
=======

.. currentmodule:: torchvision.models

The AlexNet model is based on the `ImageNet Classification with Deep Convolutional Neural Networks
<https://papers.nips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html>`__
paper.


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

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

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

alexnet
2 changes: 1 addition & 1 deletion docs/source/models/efficientnetv2.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
EfficientNetV2
============
==============

.. currentmodule:: torchvision.models

Expand Down
1 change: 1 addition & 0 deletions docs/source/models_new.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ weights:
.. toctree::
:maxdepth: 1

models/alexnet
models/convnext
models/densenet
models/efficientnet
Expand Down
26 changes: 20 additions & 6 deletions torchvision/models/alexnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,27 @@ class AlexNet_Weights(WeightsEnum):
@handle_legacy_interface(weights=("pretrained", AlexNet_Weights.IMAGENET1K_V1))
def alexnet(*, weights: Optional[AlexNet_Weights] = None, progress: bool = True, **kwargs: Any) -> AlexNet:
r"""AlexNet model architecture from the
`"One weird trick..." <https://arxiv.org/abs/1404.5997>`_ paper.
The required minimum input size of the model is 63x63.

Args:
weights (AlexNet_Weights, optional): The pretrained weights for the model
progress (bool): If True, displays a progress bar of the download to stderr
`ImageNet Classification with Deep Convolutional Neural Networks
<https://papers.nips.cc/paper/2012/hash/c399862d3b9d6b76c8436e924a68c45b-Abstract.html>`_ paper.
The required minimum input size of the model is 63x63.

Args:
weights (:class:`~torchvision.models.AlexNet_Weights`, optional): The
pretrained weights to use. See
:class:`~torchvision.models.AlexNet_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.AlexNet``
base class. Please refer to the `source code
<https://github.com/pytorch/vision/blob/main/torchvision/models/alexnet.py>`_
for more details about this class.

.. autoclass:: torchvision.models.AlexNet_Weights
:members:
"""

weights = AlexNet_Weights.verify(weights)

if weights is not None:
Expand Down