Skip to content

Commit

Permalink
add densenet docs (PaddlePaddle#3923)
Browse files Browse the repository at this point in the history
* add densenet docs

* Update DenseNet_cn.rst

* Update desnet264_cn.rst

* update DenseNet_cn.rst

* merge conflicts & add Overview

* update code-block
  • Loading branch information
fuqianya authored Nov 1, 2021
1 parent 8209703 commit 5a73bfb
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/api/paddle/vision/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ paddle.vision 目录是飞桨在视觉领域的高层API。具体如下:
" :ref:`vgg13 <cn_api_paddle_vision_models_vgg13>` ", "13层的VGG模型"
" :ref:`vgg16 <cn_api_paddle_vision_models_vgg16>` ", "16层的VGG模型"
" :ref:`vgg19 <cn_api_paddle_vision_models_vgg19>` ", "19层的VGG模型"
" :ref:`DenseNet <cn_api_paddle_vision_models_DenseNet>` ", "DenseNet模型"
" :ref:`densenet121 <cn_api_paddle_vision_models_densenet121>` ", "121层的DenseNet模型"
" :ref:`densenet161 <cn_api_paddle_vision_models_densenet161>` ", "161层的DenseNet模型"
" :ref:`densenet169 <cn_api_paddle_vision_models_densenet169>` ", "169层的DenseNet模型"
" :ref:`densenet201 <cn_api_paddle_vision_models_densenet201>` ", "201层的DenseNet模型"
" :ref:`densenet264 <cn_api_paddle_vision_models_densenet264>` ", "264层的DenseNet模型"
" :ref:`InceptionV3 <cn_api_paddle_vision_models_InceptionV3>` ", "InceptionV3模型"
" :ref:`inception_v3 <cn_api_paddle_vision_models_inception_v3>` ", "InceptionV3模型"

Expand Down
35 changes: 35 additions & 0 deletions docs/api/paddle/vision/models/DenseNet_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _cn_api_paddle_vision_models_DenseNet:

DenseNet
-------------------------------

.. py:class:: paddle.vision.models.DenseNet(layers=121, bn_size=4, dropout=0., num_classes=1000)
DenseNet模型,来自论文 `"Densely Connected Convolutional Networks" <https://arxiv.org/abs/1608.06993>`_ 。

参数
:::::::::
- **layers** (int, 可选) - densenet的层数。默认值:121。
- **bn_size** (int,可选) - 中间层growth rate的拓展倍数。默认值:4。
- **dropout** (float, 可选) - dropout rate。默认值:0.。
- **num_classes** (int,可选) - 类别数目,即最后一个全连接层输出的维度。默认值:1000。
- **with_pool** (bool,可选) - 是否定义最后一个全连接层之前的池化层。默认值:True。

返回
:::::::::
DenseNet模型,Layer的实例。

代码示例
:::::::::
.. code-block:: python
import paddle
from paddle.vision.models import DenseNet
# build model
densenet = DenseNet()
x = paddle.rand([1, 3, 224, 224])
out = densenet(x)
print(out.shape)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/desnet121_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _cn_api_paddle_vision_models_densenet121:

densenet121
-------------------------------

.. py:function:: paddle.vision.models.densenet121(pretrained=False, **kwargs)
121层的densenet模型,来自论文 `"Densely Connected Convolutional Networks" <https://arxiv.org/abs/1608.06993>`_ 。

参数
:::::::::
- **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。

返回
:::::::::
densenet121模型,Layer的实例。

代码示例
:::::::::
.. code-block:: python
import paddle
from paddle.vision.models import densenet121
# build model
model = densenet121()
# build model and load imagenet pretrained weight
# model = densenet121(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/desnet161_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _cn_api_paddle_vision_models_densenet161:

densenet161
-------------------------------

.. py:function:: paddle.vision.models.densenet161(pretrained=False, **kwargs)
161层的densenet模型,来自论文 `"Densely Connected Convolutional Networks" <https://arxiv.org/abs/1608.06993>`_ 。

参数
:::::::::
- **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。

返回
:::::::::
densenet161模型,Layer的实例。

代码示例
:::::::::
.. code-block:: python
import paddle
from paddle.vision.models import densenet161
# build model
model = densenet161()
# build model and load imagenet pretrained weight
# model = densenet161(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/desnet169_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _cn_api_paddle_vision_models_densenet169:

densenet169
-------------------------------

.. py:function:: paddle.vision.models.densenet169(pretrained=False, **kwargs)
169层的densenet模型,来自论文 `"Densely Connected Convolutional Networks" <https://arxiv.org/abs/1608.06993>`_ 。

参数
:::::::::
- **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。

返回
:::::::::
densenet169模型,Layer的实例。

代码示例
:::::::::
.. code-block:: python
import paddle
from paddle.vision.models import densenet169
# build model
model = densenet169()
# build model and load imagenet pretrained weight
# model = densenet169(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/desnet201_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _cn_api_paddle_vision_models_densenet201:

densenet201
-------------------------------

.. py:function:: paddle.vision.models.densenet201(pretrained=False, **kwargs)
201层的densenet模型,来自论文 `"Densely Connected Convolutional Networks" <https://arxiv.org/abs/1608.06993>`_ 。

参数
:::::::::
- **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。

返回
:::::::::
densenet201模型,Layer的实例。

代码示例
:::::::::
.. code-block:: python
import paddle
from paddle.vision.models import densenet201
# build model
model = densenet201()
# build model and load imagenet pretrained weight
# model = densenet201(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/desnet264_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _cn_api_paddle_vision_models_resnet264:

densenet264
-------------------------------

.. py:function:: paddle.vision.models.densenet264(pretrained=False, **kwargs)
264层的densenet模型,来自论文 `"Densely Connected Convolutional Networks" <https://arxiv.org/abs/1608.06993>`_ 。

参数
:::::::::
- **pretrained** (bool,可选) - 是否加载在imagenet数据集上的预训练权重。默认值:False。

返回
:::::::::
densenet264模型,Layer的实例。

代码示例
:::::::::
.. code-block:: python
import paddle
from paddle.vision.models import densenet264
# build model
model = densenet264()
# build model and load imagenet pretrained weight
# model = densenet264(pretrained=True)
x = paddle.rand([1, 3, 224, 224])
out = model(x)
print(out.shape)

0 comments on commit 5a73bfb

Please sign in to comment.