Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add alexnet doc #3918

Merged
merged 9 commits into from
Oct 22, 2021
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions docs/api/paddle/vision/Overview_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ paddle.vision 目录是飞桨在视觉领域的高层API。具体如下:
:widths: 10, 30

" :ref:`LeNet <cn_api_paddle_vision_models_LeNet>` ", "LeNet模型"
" :ref:`AlexNet <cn_api_paddle_vision_models_AlexNet>` ", "AlexNet模型"
" :ref:`alexnet <cn_api_paddle_vision_models_alexnet>` ", "AlexNet模型"
" :ref:`MobileNetV1 <cn_api_paddle_vision_models_MobileNetV1>` ", "MobileNetV1模型"
" :ref:`MobileNetV2 <cn_api_paddle_vision_models_MobileNetV2>` ", "MobileNetV2模型"
" :ref:`mobilenet_v1 <cn_api_paddle_vision_models_mobilenet_v1>` ", "MobileNetV1模型"
Expand Down
31 changes: 31 additions & 0 deletions docs/api/paddle/vision/models/AlexNet_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. _cn_api_paddle_vision_models_AlexNet

AlexNet
-------------------------------

.. py:function:: paddle.vision.models.AlexNet(num_classes=1000)

AlexNet模型,来自论文 `"ImageNet Classification with Deep Convolutional Neural Networks" <https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf>`_ 。

参数
:::::::::
- **num_classes** (int, 可选) - 最后一个全连接层输出的维度。默认值:1000。

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

代码示例
:::::::::
.. code-block:: python

import paddle
from paddle.vision.models import AlexNet

# build model
model = AlexNet()

x = paddle.rand([1, 3, 224, 224])
out = model(x)

print(out.shape)
34 changes: 34 additions & 0 deletions docs/api/paddle/vision/models/alexnet_cn.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
.. _cn_api_paddle_vision_models_alexnet

alexnet
-------------------------------

.. py:function:: paddle.vision.models.alexnet(pretrained=False, **kwargs)

AlexNet模型,来自论文 `"ImageNet Classification with Deep Convolutional Neural Networks" <https://papers.nips.cc/paper/2012/file/c399862d3b9d6b76c8436e924a68c45b-Paper.pdf>`_ 。

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

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

代码示例
:::::::::
.. code-block:: python

import paddle
from paddle.vision.models import alexnet

# build model
model = alexnet()

# build model and load imagenet pretrained weight
# model = alexnet(pretrained=True)

x = paddle.rand([1, 3, 224, 224])
out = model(x)

print(out.shape)