From f9d3ded4da6c821223de59848fcdb3246c824b80 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Sat, 7 May 2022 12:33:38 +0100 Subject: [PATCH 1/2] Fixing AlexNet references --- docs/source/models/alexnet.rst | 8 +++++--- torchvision/models/alexnet.py | 11 +++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/source/models/alexnet.rst b/docs/source/models/alexnet.rst index 50d541632ef..080c241983b 100644 --- a/docs/source/models/alexnet.rst +++ b/docs/source/models/alexnet.rst @@ -3,10 +3,12 @@ AlexNet .. currentmodule:: torchvision.models -The AlexNet model is based on the +The AlexNet model was originally introduced in the `ImageNet Classification with Deep Convolutional Neural Networks -`__. -paper. +`__ +paper. The implemented architecture is slightly different from the original one, +and is based on `One weird trick for parallelizing convolutional neural networks +`__. Model builders diff --git a/torchvision/models/alexnet.py b/torchvision/models/alexnet.py index 5be705ca532..78e1d488844 100644 --- a/torchvision/models/alexnet.py +++ b/torchvision/models/alexnet.py @@ -72,8 +72,15 @@ 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: - """AlexNet model architecture from the `ImageNet Classification with Deep Convolutional Neural Networks - `__ paper. + """AlexNet model architecture from `One weird trick for parallelizing convolutional neural networks +`__. + + .. note:: + AlexNet was originally introduced in the `ImageNet Classification with + Deep Convolutional Neural Networks + `__ + paper. Our implementation is based instead on the "One weird trick" + paper above. The required minimum input size of the model is 63x63. From fd3c5934332e49489735181a6fd7ab58926f918c Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 9 May 2022 13:32:28 +0100 Subject: [PATCH 2/2] Fix doc rendering --- torchvision/models/alexnet.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/torchvision/models/alexnet.py b/torchvision/models/alexnet.py index 78e1d488844..97877c52060 100644 --- a/torchvision/models/alexnet.py +++ b/torchvision/models/alexnet.py @@ -72,8 +72,9 @@ 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: - """AlexNet model architecture from `One weird trick for parallelizing convolutional neural networks -`__. + """AlexNet model architecture from `One weird trick for parallelizing convolutional neural networks `__. + + The required minimum input size of the model is 63x63. .. note:: AlexNet was originally introduced in the `ImageNet Classification with @@ -82,8 +83,6 @@ def alexnet(*, weights: Optional[AlexNet_Weights] = None, progress: bool = True, paper. Our implementation is based instead on the "One weird trick" paper above. - The required minimum input size of the model is 63x63. - Args: weights (:class:`~torchvision.models.AlexNet_Weights`, optional): The pretrained weights to use. See