Unverified Commit d1f1a544 authored by Jiawei Liu's avatar Jiawei Liu Committed by GitHub
Browse files

Document minimum required shapes for classification model builder. (#3944)



* [doc] add minimum input size for alexnet builder

* [doc] add minimum input size for vgg builder

* [doc] add minimum input size for squeezenet builder

* [doc] add minimum input size for densenet builder

* [doc] add minimum input size for inception_v3 builder

* [doc] add minimum input size for googlenet builder
Co-authored-by: default avatarVasilis Vryniotis <datumbox@users.noreply.github.com>
parent f6b6b510
...@@ -53,6 +53,7 @@ class AlexNet(nn.Module): ...@@ -53,6 +53,7 @@ class AlexNet(nn.Module):
def alexnet(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> AlexNet: def alexnet(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> AlexNet:
r"""AlexNet model architecture from the r"""AlexNet model architecture from the
`"One weird trick..." <https://arxiv.org/abs/1404.5997>`_ paper. `"One weird trick..." <https://arxiv.org/abs/1404.5997>`_ paper.
The required minimum input size of the model is 63x63.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
......
...@@ -257,6 +257,7 @@ def _densenet( ...@@ -257,6 +257,7 @@ def _densenet(
def densenet121(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet: def densenet121(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
r"""Densenet-121 model from r"""Densenet-121 model from
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_. `"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
The required minimum input size of the model is 29x29.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -271,6 +272,7 @@ def densenet121(pretrained: bool = False, progress: bool = True, **kwargs: Any) ...@@ -271,6 +272,7 @@ def densenet121(pretrained: bool = False, progress: bool = True, **kwargs: Any)
def densenet161(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet: def densenet161(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
r"""Densenet-161 model from r"""Densenet-161 model from
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_. `"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
The required minimum input size of the model is 29x29.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -285,6 +287,7 @@ def densenet161(pretrained: bool = False, progress: bool = True, **kwargs: Any) ...@@ -285,6 +287,7 @@ def densenet161(pretrained: bool = False, progress: bool = True, **kwargs: Any)
def densenet169(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet: def densenet169(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
r"""Densenet-169 model from r"""Densenet-169 model from
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_. `"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
The required minimum input size of the model is 29x29.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -299,6 +302,7 @@ def densenet169(pretrained: bool = False, progress: bool = True, **kwargs: Any) ...@@ -299,6 +302,7 @@ def densenet169(pretrained: bool = False, progress: bool = True, **kwargs: Any)
def densenet201(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet: def densenet201(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> DenseNet:
r"""Densenet-201 model from r"""Densenet-201 model from
`"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_. `"Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf>`_.
The required minimum input size of the model is 29x29.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
......
...@@ -26,6 +26,7 @@ _GoogLeNetOutputs = GoogLeNetOutputs ...@@ -26,6 +26,7 @@ _GoogLeNetOutputs = GoogLeNetOutputs
def googlenet(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> "GoogLeNet": def googlenet(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> "GoogLeNet":
r"""GoogLeNet (Inception v1) model architecture from r"""GoogLeNet (Inception v1) model architecture from
`"Going Deeper with Convolutions" <http://arxiv.org/abs/1409.4842>`_. `"Going Deeper with Convolutions" <http://arxiv.org/abs/1409.4842>`_.
The required minimum input size of the model is 15x15.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
......
...@@ -26,6 +26,7 @@ _InceptionOutputs = InceptionOutputs ...@@ -26,6 +26,7 @@ _InceptionOutputs = InceptionOutputs
def inception_v3(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> "Inception3": def inception_v3(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> "Inception3":
r"""Inception v3 model architecture from r"""Inception v3 model architecture from
`"Rethinking the Inception Architecture for Computer Vision" <http://arxiv.org/abs/1512.00567>`_. `"Rethinking the Inception Architecture for Computer Vision" <http://arxiv.org/abs/1512.00567>`_.
The required minimum input size of the model is 75x75.
.. note:: .. note::
**Important**: In contrast to the other models the inception_v3 expects tensors with a size of **Important**: In contrast to the other models the inception_v3 expects tensors with a size of
......
...@@ -126,6 +126,7 @@ def squeezenet1_0(pretrained: bool = False, progress: bool = True, **kwargs: Any ...@@ -126,6 +126,7 @@ def squeezenet1_0(pretrained: bool = False, progress: bool = True, **kwargs: Any
r"""SqueezeNet model architecture from the `"SqueezeNet: AlexNet-level r"""SqueezeNet model architecture from the `"SqueezeNet: AlexNet-level
accuracy with 50x fewer parameters and <0.5MB model size" accuracy with 50x fewer parameters and <0.5MB model size"
<https://arxiv.org/abs/1602.07360>`_ paper. <https://arxiv.org/abs/1602.07360>`_ paper.
The required minimum input size of the model is 21x21.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -139,6 +140,7 @@ def squeezenet1_1(pretrained: bool = False, progress: bool = True, **kwargs: Any ...@@ -139,6 +140,7 @@ def squeezenet1_1(pretrained: bool = False, progress: bool = True, **kwargs: Any
<https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>`_. <https://github.com/DeepScale/SqueezeNet/tree/master/SqueezeNet_v1.1>`_.
SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters SqueezeNet 1.1 has 2.4x less computation and slightly fewer parameters
than SqueezeNet 1.0, without sacrificing accuracy. than SqueezeNet 1.0, without sacrificing accuracy.
The required minimum input size of the model is 17x17.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
......
...@@ -105,6 +105,7 @@ def _vgg(arch: str, cfg: str, batch_norm: bool, pretrained: bool, progress: bool ...@@ -105,6 +105,7 @@ def _vgg(arch: str, cfg: str, batch_norm: bool, pretrained: bool, progress: bool
def vgg11(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg11(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 11-layer model (configuration "A") from r"""VGG 11-layer model (configuration "A") from
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -116,6 +117,7 @@ def vgg11(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG ...@@ -116,6 +117,7 @@ def vgg11(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG
def vgg11_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg11_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 11-layer model (configuration "A") with batch normalization r"""VGG 11-layer model (configuration "A") with batch normalization
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -127,6 +129,7 @@ def vgg11_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ...@@ -127,6 +129,7 @@ def vgg11_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) ->
def vgg13(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg13(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 13-layer model (configuration "B") r"""VGG 13-layer model (configuration "B")
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -138,6 +141,7 @@ def vgg13(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG ...@@ -138,6 +141,7 @@ def vgg13(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG
def vgg13_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg13_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 13-layer model (configuration "B") with batch normalization r"""VGG 13-layer model (configuration "B") with batch normalization
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -149,6 +153,7 @@ def vgg13_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ...@@ -149,6 +153,7 @@ def vgg13_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) ->
def vgg16(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg16(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 16-layer model (configuration "D") r"""VGG 16-layer model (configuration "D")
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -160,6 +165,7 @@ def vgg16(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG ...@@ -160,6 +165,7 @@ def vgg16(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG
def vgg16_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg16_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 16-layer model (configuration "D") with batch normalization r"""VGG 16-layer model (configuration "D") with batch normalization
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -171,6 +177,7 @@ def vgg16_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ...@@ -171,6 +177,7 @@ def vgg16_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) ->
def vgg19(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg19(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 19-layer model (configuration "E") r"""VGG 19-layer model (configuration "E")
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
...@@ -182,6 +189,7 @@ def vgg19(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG ...@@ -182,6 +189,7 @@ def vgg19(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG
def vgg19_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG: def vgg19_bn(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> VGG:
r"""VGG 19-layer model (configuration 'E') with batch normalization r"""VGG 19-layer model (configuration 'E') with batch normalization
`"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_. `"Very Deep Convolutional Networks For Large-Scale Image Recognition" <https://arxiv.org/pdf/1409.1556.pdf>`_.
The required minimum input size of the model is 32x32.
Args: Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet pretrained (bool): If True, returns a model pre-trained on ImageNet
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment