Skip to content
Merged
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
83 changes: 69 additions & 14 deletions python/paddle/vision/models/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,16 @@ class ResNet(nn.Layer):

Args:
Block (BasicBlock|BottleneckBlock): block module of model.
depth (int, optional): layers of resnet, Default: 50.
depth (int, optional): layers of ResNet, Default: 50.
width (int, optional): base width per convolution group for each convolution block, Default: 64.
num_classes (int, optional): output dim of last fc layer. If num_classes <=0, last fc layer
will not be defined. Default: 1000.
with_pool (bool, optional): use pool before the last fc layer or not. Default: True.
groups (int, optional): number of groups for each convolution block, Default: 1.

Returns:
ResNet model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python

Expand Down Expand Up @@ -330,7 +333,11 @@ def resnet18(pretrained=False, **kwargs):
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNet 18-layer model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -358,7 +365,11 @@ def resnet34(pretrained=False, **kwargs):
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNet 34-layer model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -386,7 +397,11 @@ def resnet50(pretrained=False, **kwargs):
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNet 50-layer model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -414,7 +429,11 @@ def resnet101(pretrained=False, **kwargs):
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNet 101-layer. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -442,7 +461,11 @@ def resnet152(pretrained=False, **kwargs):
`"Deep Residual Learning for Image Recognition" <https://arxiv.org/pdf/1512.03385.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNet 152-layer model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -470,7 +493,11 @@ def resnext50_32x4d(pretrained=False, **kwargs):
`"Aggregated Residual Transformations for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNeXt-50 32x4d model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -500,7 +527,11 @@ def resnext50_64x4d(pretrained=False, **kwargs):
`"Aggregated Residual Transformations for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNeXt-50 64x4d model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -530,7 +561,11 @@ def resnext101_32x4d(pretrained=False, **kwargs):
`"Aggregated Residual Transformations for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNeXt-101 32x4d model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -561,7 +596,11 @@ def resnext101_64x4d(pretrained=False, **kwargs):
`"Aggregated Residual Transformations for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNeXt-101 64x4d model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -592,7 +631,11 @@ def resnext152_32x4d(pretrained=False, **kwargs):
`"Aggregated Residual Transformations for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNeXt-152 32x4d model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -623,7 +666,11 @@ def resnext152_64x4d(pretrained=False, **kwargs):
`"Aggregated Residual Transformations for Deep Neural Networks" <https://arxiv.org/pdf/1611.05431.pdf>`_

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
ResNeXt-152 64x4d model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -654,7 +701,11 @@ def wide_resnet50_2(pretrained=False, **kwargs):
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
Wide ResNet-50-2 model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down Expand Up @@ -683,7 +734,11 @@ def wide_resnet101_2(pretrained=False, **kwargs):
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.

Args:
pretrained (bool, optional): If True, returns a model pre-trained on ImageNet. Default: False.
pretrained (bool, optional): Whether to load pre-trained weights. If True, returns a model pre-trained
on ImageNet. Default: False.

Returns:
Wide ResNet-101-2 model. An instance of :ref:`api_fluid_dygraph_Layer`.

Examples:
.. code-block:: python
Expand Down