From 9d31f0d5b063bfce569b2196a232e17d33842828 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Mon, 1 Nov 2021 09:12:31 +0800 Subject: [PATCH] [PaddlePaddle Hackathon] add ResNeXt zh doc (#3922) * add resnext * sync with en docs Co-authored-by: Ainavo * fix arguments * add resnext into overview * update resnext API * update API parameters * layers -> depth * trigger CI Co-authored-by: Ainavo --- docs/api/paddle/vision/Overview_cn.rst | 8 ++++- docs/api/paddle/vision/models/ResNeXt_cn.rst | 33 ++++++++++++++++++ .../vision/models/resnext101_32x4d_cn.rst | 34 +++++++++++++++++++ .../vision/models/resnext101_64x4d_cn.rst | 34 +++++++++++++++++++ .../vision/models/resnext152_32x4d_cn.rst | 34 +++++++++++++++++++ .../vision/models/resnext152_64x4d_cn.rst | 34 +++++++++++++++++++ .../vision/models/resnext50_32x4d_cn.rst | 34 +++++++++++++++++++ .../vision/models/resnext50_64x4d_cn.rst | 34 +++++++++++++++++++ 8 files changed, 244 insertions(+), 1 deletion(-) create mode 100644 docs/api/paddle/vision/models/ResNeXt_cn.rst create mode 100644 docs/api/paddle/vision/models/resnext101_32x4d_cn.rst create mode 100644 docs/api/paddle/vision/models/resnext101_64x4d_cn.rst create mode 100644 docs/api/paddle/vision/models/resnext152_32x4d_cn.rst create mode 100644 docs/api/paddle/vision/models/resnext152_64x4d_cn.rst create mode 100644 docs/api/paddle/vision/models/resnext50_32x4d_cn.rst create mode 100644 docs/api/paddle/vision/models/resnext50_64x4d_cn.rst diff --git a/docs/api/paddle/vision/Overview_cn.rst b/docs/api/paddle/vision/Overview_cn.rst index fef448aa247..ec955eb3d19 100644 --- a/docs/api/paddle/vision/Overview_cn.rst +++ b/docs/api/paddle/vision/Overview_cn.rst @@ -49,6 +49,13 @@ paddle.vision 目录是飞桨在视觉领域的高层API。具体如下: " :ref:`resnet50 ` ", "50层的ResNet模型" " :ref:`resnet101 ` ", "101层的ResNet模型" " :ref:`resnet152 ` ", "152层的ResNet模型" + " :ref:`ResNeXt ` ", "ResNeXt模型" + " :ref:`resnext50_32x4d ` ", "ResNeXt-50 32x4d模型" + " :ref:`resnext50_64x4d ` ", "ResNeXt-50 64x4d模型" + " :ref:`resnext101_32x4d ` ", "ResNeXt-101 32x4d模型" + " :ref:`resnext101_64x4d ` ", "ResNeXt-101 64x4d模型" + " :ref:`resnext152_32x4d ` ", "ResNeXt-152 32x4d模型" + " :ref:`resnext152_64x4d ` ", "ResNeXt-152 64x4d模型" " :ref:`VGG ` ", "VGG模型" " :ref:`vgg11 ` ", "11层的VGG模型" " :ref:`vgg13 ` ", "13层的VGG模型" @@ -63,7 +70,6 @@ paddle.vision 目录是飞桨在视觉领域的高层API。具体如下: " :ref:`InceptionV3 ` ", "InceptionV3模型" " :ref:`inception_v3 ` ", "InceptionV3模型" - .. _about_ops: 视觉操作相关API diff --git a/docs/api/paddle/vision/models/ResNeXt_cn.rst b/docs/api/paddle/vision/models/ResNeXt_cn.rst new file mode 100644 index 00000000000..9483cca4a1b --- /dev/null +++ b/docs/api/paddle/vision/models/ResNeXt_cn.rst @@ -0,0 +1,33 @@ +.. _cn_api_paddle_vision_models_ResNeXt: + +ResNeXt +------------------------------- + +.. py:class:: paddle.vision.models.ResNeXt(layers=50, cardinality=32, num_classes=1000, with_pool=True) + + ResNeXt模型,来自论文 `"Aggregated Residual Transformations for Deep Neural Networks" `_ 。 + +参数 +::::::::: + - **layers** (int,可选) - ResNeXt 模型的深度。默认值:50 + - **cardinality** (int,可选) - 模型基数,也即划分组的数量。默认值:32 + - **num_classes** (int, 可选) - 最后一个全连接层输出的维度。如果该值小于0,则不定义最后一个全连接层。默认值:1000。 + - **with_pool** (bool,可选) - 是否定义最后一个全连接层之前的池化层。默认值:True。 + +返回 +::::::::: +ResNeXt模型,Layer的实例。 + +代码示例 +::::::::: +.. code-block:: python + + import paddle + from paddle.vision.models import ResNeXt + + resnext50_32x4d = ResNeXt(depth=50, cardinality=32) + + x = paddle.rand([1, 3, 224, 224]) + out = resnext50_32x4d(x) + + print(out.shape) \ No newline at end of file diff --git a/docs/api/paddle/vision/models/resnext101_32x4d_cn.rst b/docs/api/paddle/vision/models/resnext101_32x4d_cn.rst new file mode 100644 index 00000000000..f4536b0109e --- /dev/null +++ b/docs/api/paddle/vision/models/resnext101_32x4d_cn.rst @@ -0,0 +1,34 @@ +.. _cn_api_paddle_vision_models_resnext101_32x4d: + +resnext101_32x4d +------------------------------- + +.. py:function:: paddle.vision.models.resnext101_32x4d(pretrained=False, **kwargs) + + ResNeXt-101 32x4d模型,来自论文 `"Aggregated Residual Transformations for Deep Neural Networks" `_ 。 + +参数 +::::::::: + - **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。 + +返回 +::::::::: +resnext101_32x4d模型,Layer的实例。 + +代码示例 +::::::::: +.. code-block:: python + + import paddle + from paddle.vision.models import resnext101_32x4d + + # build model + model = resnext101_32x4d() + + # build model and load imagenet pretrained weight + # model = resnext101_32x4d(pretrained=True) + + x = paddle.rand([1, 3, 224, 224]) + out = model(x) + + print(out.shape) diff --git a/docs/api/paddle/vision/models/resnext101_64x4d_cn.rst b/docs/api/paddle/vision/models/resnext101_64x4d_cn.rst new file mode 100644 index 00000000000..ea7ada6e16b --- /dev/null +++ b/docs/api/paddle/vision/models/resnext101_64x4d_cn.rst @@ -0,0 +1,34 @@ +.. _cn_api_paddle_vision_models_resnext101_64x4d: + +resnext101_64x4d +------------------------------- + +.. py:function:: paddle.vision.models.resnext101_64x4d(pretrained=False, **kwargs) + + ResNeXt-101 64x4d模型,来自论文 `"Aggregated Residual Transformations for Deep Neural Networks" `_ 。 + +参数 +::::::::: + - **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。 + +返回 +::::::::: +resnext101_64x4d模型,Layer的实例。 + +代码示例 +::::::::: +.. code-block:: python + + import paddle + from paddle.vision.models import resnext101_64x4d + + # build model + model = resnext101_64x4d() + + # build model and load imagenet pretrained weight + # model = resnext101_64x4d(pretrained=True) + + x = paddle.rand([1, 3, 224, 224]) + out = model(x) + + print(out.shape) diff --git a/docs/api/paddle/vision/models/resnext152_32x4d_cn.rst b/docs/api/paddle/vision/models/resnext152_32x4d_cn.rst new file mode 100644 index 00000000000..baa59e8d173 --- /dev/null +++ b/docs/api/paddle/vision/models/resnext152_32x4d_cn.rst @@ -0,0 +1,34 @@ +.. _cn_api_paddle_vision_models_resnext152_32x4d: + +resnext152_32x4d +------------------------------- + +.. py:function:: paddle.vision.models.resnext152_32x4d(pretrained=False, **kwargs) + + ResNeXt-152 32x4d模型,来自论文 `"Aggregated Residual Transformations for Deep Neural Networks" `_ 。 + +参数 +::::::::: + - **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。 + +返回 +::::::::: +resnext152_32x4d模型,Layer的实例。 + +代码示例 +::::::::: +.. code-block:: python + + import paddle + from paddle.vision.models import resnext152_32x4d + + # build model + model = resnext152_32x4d() + + # build model and load imagenet pretrained weight + # model = resnext152_32x4d(pretrained=True) + + x = paddle.rand([1, 3, 224, 224]) + out = model(x) + + print(out.shape) diff --git a/docs/api/paddle/vision/models/resnext152_64x4d_cn.rst b/docs/api/paddle/vision/models/resnext152_64x4d_cn.rst new file mode 100644 index 00000000000..585d8c5a956 --- /dev/null +++ b/docs/api/paddle/vision/models/resnext152_64x4d_cn.rst @@ -0,0 +1,34 @@ +.. _cn_api_paddle_vision_models_resnext152_64x4d: + +resnext152_64x4d +------------------------------- + +.. py:function:: paddle.vision.models.resnext152_64x4d(pretrained=False, **kwargs) + + ResNeXt-152 64x4d模型,来自论文 `"Aggregated Residual Transformations for Deep Neural Networks" `_ 。 + +参数 +::::::::: + - **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。 + +返回 +::::::::: +resnext152_64x4d模型,Layer的实例。 + +代码示例 +::::::::: +.. code-block:: python + + import paddle + from paddle.vision.models import resnext152_64x4d + + # build model + model = resnext152_64x4d() + + # build model and load imagenet pretrained weight + # model = resnext152_64x4d(pretrained=True) + + x = paddle.rand([1, 3, 224, 224]) + out = model(x) + + print(out.shape) diff --git a/docs/api/paddle/vision/models/resnext50_32x4d_cn.rst b/docs/api/paddle/vision/models/resnext50_32x4d_cn.rst new file mode 100644 index 00000000000..0850861a243 --- /dev/null +++ b/docs/api/paddle/vision/models/resnext50_32x4d_cn.rst @@ -0,0 +1,34 @@ +.. _cn_api_paddle_vision_models_resnext50_32x4d: + +resnext50_32x4d +------------------------------- + +.. py:function:: paddle.vision.models.resnext50_32x4d(pretrained=False, **kwargs) + + ResNeXt-50 32x4d模型,来自论文 `"Aggregated Residual Transformations for Deep Neural Networks" `_ 。 + +参数 +::::::::: + - **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。 + +返回 +::::::::: +resnext50_32x4d模型,Layer的实例。 + +代码示例 +::::::::: +.. code-block:: python + + import paddle + from paddle.vision.models import resnext50_32x4d + + # build model + model = resnext50_32x4d() + + # build model and load imagenet pretrained weight + # model = resnext50_32x4d(pretrained=True) + + x = paddle.rand([1, 3, 224, 224]) + out = model(x) + + print(out.shape) diff --git a/docs/api/paddle/vision/models/resnext50_64x4d_cn.rst b/docs/api/paddle/vision/models/resnext50_64x4d_cn.rst new file mode 100644 index 00000000000..1f81e17e13c --- /dev/null +++ b/docs/api/paddle/vision/models/resnext50_64x4d_cn.rst @@ -0,0 +1,34 @@ +.. _cn_api_paddle_vision_models_resnext50_64x4d: + +resnext50_64x4d +------------------------------- + +.. py:function:: paddle.vision.models.resnext50_64x4d(pretrained=False, **kwargs) + + ResNeXt-50 64x4d模型,来自论文 `"Aggregated Residual Transformations for Deep Neural Networks" `_ 。 + +参数 +::::::::: + - **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。 + +返回 +::::::::: +resnext50_64x4d模型,Layer的实例。 + +代码示例 +::::::::: +.. code-block:: python + + import paddle + from paddle.vision.models import resnext50_64x4d + + # build model + model = resnext50_64x4d() + + # build model and load imagenet pretrained weight + # model = resnext50_64x4d(pretrained=True) + + x = paddle.rand([1, 3, 224, 224]) + out = model(x) + + print(out.shape)