Skip to content

Commit

Permalink
[PaddlePaddle Hackathon] add ResNeXt zh doc (PaddlePaddle#3922)
Browse files Browse the repository at this point in the history
* add resnext

* sync with en docs

Co-authored-by: Ainavo <[email protected]>

* fix arguments

* add resnext into overview

* update resnext API

* update API parameters

* layers -> depth

* trigger CI

Co-authored-by: Ainavo <[email protected]>
  • Loading branch information
SigureMo and Ainavo authored Nov 1, 2021
1 parent 5a73bfb commit 9d31f0d
Show file tree
Hide file tree
Showing 8 changed files with 244 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/api/paddle/vision/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ paddle.vision 目录是飞桨在视觉领域的高层API。具体如下:
" :ref:`resnet50 <cn_api_paddle_vision_models_resnet50>` ", "50层的ResNet模型"
" :ref:`resnet101 <cn_api_paddle_vision_models_resnet101>` ", "101层的ResNet模型"
" :ref:`resnet152 <cn_api_paddle_vision_models_resnet152>` ", "152层的ResNet模型"
" :ref:`ResNeXt <cn_api_paddle_vision_models_ResNeXt>` ", "ResNeXt模型"
" :ref:`resnext50_32x4d <cn_api_paddle_vision_models_resnext50_32x4d>` ", "ResNeXt-50 32x4d模型"
" :ref:`resnext50_64x4d <cn_api_paddle_vision_models_resnext50_64x4d>` ", "ResNeXt-50 64x4d模型"
" :ref:`resnext101_32x4d <cn_api_paddle_vision_models_resnext101_32x4d>` ", "ResNeXt-101 32x4d模型"
" :ref:`resnext101_64x4d <cn_api_paddle_vision_models_resnext101_64x4d>` ", "ResNeXt-101 64x4d模型"
" :ref:`resnext152_32x4d <cn_api_paddle_vision_models_resnext152_32x4d>` ", "ResNeXt-152 32x4d模型"
" :ref:`resnext152_64x4d <cn_api_paddle_vision_models_resnext152_64x4d>` ", "ResNeXt-152 64x4d模型"
" :ref:`VGG <cn_api_paddle_vision_models_VGG>` ", "VGG模型"
" :ref:`vgg11 <cn_api_paddle_vision_models_vgg11>` ", "11层的VGG模型"
" :ref:`vgg13 <cn_api_paddle_vision_models_vgg13>` ", "13层的VGG模型"
Expand All @@ -63,7 +70,6 @@ paddle.vision 目录是飞桨在视觉领域的高层API。具体如下:
" :ref:`InceptionV3 <cn_api_paddle_vision_models_InceptionV3>` ", "InceptionV3模型"
" :ref:`inception_v3 <cn_api_paddle_vision_models_inception_v3>` ", "InceptionV3模型"


.. _about_ops:

视觉操作相关API
Expand Down
33 changes: 33 additions & 0 deletions docs/api/paddle/vision/models/ResNeXt_cn.rst
Original file line number Diff line number Diff line change
@@ -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" <https://arxiv.org/pdf/1611.05431.pdf>`_ 。

参数
:::::::::
- **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)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/resnext101_32x4d_cn.rst
Original file line number Diff line number Diff line change
@@ -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" <https://arxiv.org/pdf/1611.05431.pdf>`_ 。

参数
:::::::::
- **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)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/resnext101_64x4d_cn.rst
Original file line number Diff line number Diff line change
@@ -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" <https://arxiv.org/pdf/1611.05431.pdf>`_ 。

参数
:::::::::
- **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)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/resnext152_32x4d_cn.rst
Original file line number Diff line number Diff line change
@@ -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" <https://arxiv.org/pdf/1611.05431.pdf>`_ 。

参数
:::::::::
- **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)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/resnext152_64x4d_cn.rst
Original file line number Diff line number Diff line change
@@ -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" <https://arxiv.org/pdf/1611.05431.pdf>`_ 。

参数
:::::::::
- **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)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/resnext50_32x4d_cn.rst
Original file line number Diff line number Diff line change
@@ -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" <https://arxiv.org/pdf/1611.05431.pdf>`_ 。

参数
:::::::::
- **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)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/resnext50_64x4d_cn.rst
Original file line number Diff line number Diff line change
@@ -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" <https://arxiv.org/pdf/1611.05431.pdf>`_ 。

参数
:::::::::
- **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)

0 comments on commit 9d31f0d

Please sign in to comment.