未验证 提交 4f0d0d13 编写于 作者: C Cheerego 提交者: GitHub

Recheck structure&typo&deadlink (#799)

* recheck_structure&fix_typo

* fix_structure

* adjust_dist_structure

* fix_deadlink

* fix deadlink
上级 660dfc5c
.vscode/
/doc/fluid/menu.zh.json
/doc/fluid/menu.en.json
......@@ -46,7 +46,7 @@ API详细使用方法参考 :ref:`cn_api_fluid_ParallelExecutor` ,简单实例
提高通信速度
==========
要减少通信数据量,提高通信速度,主要是使用稀疏更新 ,目前支持 `稀疏更新 <../layers/sparse_update.html>`_ 的主要是 :ref:`cn_api_fluid_layers_embedding` 。
要减少通信数据量,提高通信速度,主要是使用稀疏更新 ,目前支持 :ref:`api_guide_sparse_update` 的主要是 :ref:`cn_api_fluid_layers_embedding` 。
.. code-block:: python
......
......@@ -3,7 +3,7 @@
#########
.. toctree::
:hidden:
:maxdepth: 1
cpu_train_best_practice.rst
dist_training_gpu.rst
......@@ -6,15 +6,15 @@
- 测试模型 ResNet50,MobileNet,ResNet101, Inception V3.
## 测试对象
**PaddlePaddle, Pytorch, Tensorflow**
**PaddlePaddle, Pytorch, Tensorflow**
- 在测试中,PaddlePaddle使用子图优化的方式集成了TensorRT, 模型[地址](https://github.com/PaddlePaddle/models/tree/develop/fluid/PaddleCV/image_classification/models)
- 在测试中,PaddlePaddle使用子图优化的方式集成了TensorRT, 模型[地址](https://github.com/PaddlePaddle/models/tree/develop/PaddleCV/image_classification/models)
- Pytorch使用了原生的实现, 模型[地址1](https://github.com/pytorch/vision/tree/master/torchvision/models)[地址2](https://github.com/marvis/pytorch-mobilenet)
- 对TensorFlow测试包括了对TF的原生的测试,和对TF—TRT的测试,**对TF—TRT的测试并没有达到预期的效果,后期会对其进行补充**, 模型[地址](https://github.com/tensorflow/models)
### ResNet50
### ResNet50
|batch_size|PaddlePaddle(ms)|Pytorch(ms)|TensorFlow(ms)|
|---|---|---|---|
|1|4.64117 |16.3|10.878|
......
......@@ -359,5 +359,5 @@ Fluid使用Executor.run来运行一段Program。
[6.099215 ]], dtype=float32), array([1.6935859], dtype=float32)]
```
至此您已经了解了Fluid 内部的执行流程的核心概念,更多框架使用细节请参考[使用指南](../../user_guides/index.html)相关内容,[模型库](../../user_guides/models/index_cn.html
至此您已经了解了Fluid 内部的执行流程的核心概念,更多框架使用细节请参考[使用指南](../../user_guides/index_cn.html)相关内容,[模型库](../../user_guides/models/index_cn.html
)中也为您提供了丰富的模型示例以供参考。
# Github提交PR指南
# 提交PR注意事项
## 建立 Issue 并完成 Pull Request
......
#############
新增Operator
新增OP
#############
本部分将指导您如何新增Operator,也包括一些必要的注意事项
......
# 如何写新的op
# 如何写新的OP
## 概念简介
......
# op相关注意事项
# OP相关注意事项
## Fluid中Op的构建逻辑
### 1.Fluid中Op的构建逻辑
......
......@@ -11,7 +11,7 @@ The Fluid framework is designed to run on a variety of devices and third-party l
Operator inheritance diagram:
![op_inheritance_relation_diagram](../../pics/op_inheritance_relation_diagram.png)
For further information, please refer to: [multi_devices](https://github.com/PaddlePaddle/FluidDoc/tree/develop/doc/fluid/design/multi_devices) , [scope](https://github.com/PaddlePaddle/FluidDoc/Blob/develop/doc/fluid/design/concepts/scope.md) , [Developer's_Guide_to_Paddle_Fluid](https://github.com/PaddlePaddle/FluidDoc/blob/release/1.2/doc/fluid/getstarted/Developer's_Guide_to_Paddle_Fluid.md)
For further information, please refer to: [multi_devices](https://github.com/PaddlePaddle/FluidDoc/tree/develop/doc/fluid/design/multi_devices) , [scope](https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/design/concepts/scope.md) , [Developer's_Guide_to_Paddle_Fluid](https://github.com/PaddlePaddle/FluidDoc/blob/release/1.2/doc/fluid/getstarted/Developer's_Guide_to_Paddle_Fluid.md)
### 2.Op's registration logic
The registration entries for each Operator include:
......
......@@ -2,17 +2,19 @@
进阶使用
########
.. todo::
如果您非常熟悉 Fluid,期望获得更高效的模型或者定义自己的Operator,请阅读:
- `Fluid 设计思想 <../advanced_usage/design_idea/fluid_design_idea.html>`_:介绍 Fluid 底层的设计思想,帮助您更好的理解框架运作过程
- `预测部署 <../advanced_usage/deploy/index_cn.html>`_ :介绍如何应用训练好的模型进行预测
- `预测部署 <../advanced_usage/deploy/index_cn.html>`_ :介绍如何应用训练好的模型进行预测
- `新增OP <../advanced_usage/development/new_op/index_cn.html>`_ :介绍新增operator的方法及注意事项
- `新增operator <../advanced_usage/development/new_op/index_cn.html>`_ :介绍新增operator的方法及注意事项
- `性能调优 <../advanced_usage/development/profiling/index_cn.html>`_ :介绍 Fluid 使用过程中的调优方法
- `性能调优 <../advanced_usage/development/profiling/index_cn.html>`_ :介绍 Fluid 使用过程中的调优方法
- `最佳实践 <../advanced_usage/best_practice/index_cn.html>`_
- `模型压缩工具库 <../advanced_usage/paddle_slim/paddle_slim.html>`_
非常欢迎您为我们的开源社区做出贡献,关于如何贡献您的代码或文档,请阅读:
......@@ -27,7 +29,7 @@
deploy/index_cn.rst
development/new_op/index_cn.rst
development/profiling/index_cn.rst
development/contribute_to_paddle/index_cn.rst
development/write_docs_cn.md
best_practice/index_cn.rst
paddle_slim/paddle_slim.md
development/contribute_to_paddle/index_cn.rst
development/write_docs_cn.md
......@@ -26,7 +26,7 @@ DataFeeder将reader返回的数据转换为可以输入Executor和ParallelExecut
result = feeder.feed([([0] * 784, [9]), ([1] * 784, [1])])
如果您想在使用多个GPU训练模型时预先将数据单独输入GPU端,可以使用decorate_reader函数。
如果您想在使用多个GPU训练模型时预先将数据单独输入GPU端,可以使用decorate_reader函数。
**代码示例**
......@@ -90,7 +90,7 @@ DataFeeder将reader返回的数据转换为可以输入Executor和ParallelExecut
.. note::
.. note::
设备数量和mini-batches数量必须一致。
......@@ -121,7 +121,7 @@ Reader
- reader是一个读取数据(从文件、网络、随机数生成器等)并生成数据项的函数。
- reader creator是返回reader函数的函数。
- reader decorator是一个函数,它接受一个或多个reader,并返回一个reader。
- batch reader是一个函数,它读取数据(从reader、文件、网络、随机数生成器等)并生成一批数据项。
- batch reader是一个函数,它读取数据(从reader、文件、网络、随机数生成器等)并生成一批数据项。
Data Reader Interface
......@@ -133,10 +133,10 @@ Data Reader Interface
iterable = data_reader()
从iterable生成的元素应该是单个数据条目,而不是mini batch。数据输入可以是单个项目,也可以是项目的元组,但应为 `支持的类型 <http://www.paddlepaddle.org/doc/ui/data_provider/pydataprovider2.html?highlight=dense_vector#input-types>`_ (如, numpy 1d array of float32, int, list of int)
从iterable生成的元素应该是单个数据条目,而不是mini batch。数据输入可以是单个项目,也可以是项目的元组,但应为 `支持的类型 <../../user_guides/howto/prepare_data/feeding_data.html#fluid>`_ (如, numpy 1d array of float32, int, list of int)
单项目数据读取器创建者的示例实现:
单项目数据读取器创建者的示例实现:
.. code-block:: python
......@@ -147,7 +147,7 @@ Data Reader Interface
return reader
多项目数据读取器创建者的示例实现:
多项目数据读取器创建者的示例实现:
.. code-block:: python
......@@ -194,11 +194,11 @@ Data Reader Interface
参数:
- **readers** - 将被组合的多个读取器。
- **check_alignment** (bool) - 如果为True,将检查输入reader是否正确对齐。如果为False,将不检查对齐,将丢弃跟踪输出。默认值True。
- **check_alignment** (bool) - 如果为True,将检查输入reader是否正确对齐。如果为False,将不检查对齐,将丢弃跟踪输出。默认值True。
返回:新的数据读取器
抛出异常: ``ComposeNotAligned`` – reader的输出不一致。 当check_alignment设置为False,不会升高。
抛出异常: ``ComposeNotAligned`` – reader的输出不一致。 当check_alignment设置为False,不会升高。
......@@ -220,7 +220,7 @@ Data Reader Interface
创建数据读取器,该reader的数据输出将被无序排列。
由原始reader创建的迭代器的输出将被缓冲到shuffle缓冲区,然后进行打乱。打乱缓冲区的大小由参数buf_size决定。
由原始reader创建的迭代器的输出将被缓冲到shuffle缓冲区,然后进行打乱。打乱缓冲区的大小由参数buf_size决定。
参数:
- **reader** (callable) – 输出会被打乱的原始reader
......@@ -257,7 +257,7 @@ Data Reader Interface
PipeReader通过流从一个命令中读取数据,将它的stdout放到管道缓冲区中,并将其重定向到解析器进行解析,然后根据需要的格式生成数据。
您可以使用标准Linux命令或调用其他Program来读取数据,例如通过HDFS、CEPH、URL、AWS S3中读取:
您可以使用标准Linux命令或调用其他Program来读取数据,例如通过HDFS、CEPH、URL、AWS S3中读取:
**代码示例**
......@@ -340,7 +340,7 @@ Creator包包含一些简单的reader creator,可以在用户Program中使用
.. py:function:: paddle.reader.creator.np_array(x)
如果是numpy向量,则创建一个生成x个元素的读取器。或者,如果它是一个numpy矩阵,创建一个生成x行元素的读取器。或由最高维度索引的任何子超平面。
如果是numpy向量,则创建一个生成x个元素的读取器。或者,如果它是一个numpy矩阵,创建一个生成x行元素的读取器。或由最高维度索引的任何子超平面。
参数:
- **x** – 用于创建reader的numpy数组。
......@@ -359,7 +359,7 @@ Creator包包含一些简单的reader creator,可以在用户Program中使用
.. py:function:: paddle.reader.creator.recordio(paths, buf_size=100)
从给定的recordio文件路径创建数据reader,用“,”分隔“,支持全局模式。
从给定的recordio文件路径创建数据reader,用“,”分隔“,支持全局模式。
路径:recordio文件的路径,可以是字符串或字符串列表。
......
......@@ -5,12 +5,13 @@ API
.. toctree::
:maxdepth: 1
../api_guides/index.rst
../api_guides/index_cn.rst
fluid_cn.rst
average_cn.rst
backward_cn.rst
clip_cn.rst
data_feeder_cn.rst
dataset_cn.rst
executor_cn.rst
initializer_cn.rst
io_cn.rst
......@@ -21,6 +22,5 @@ API
profiler_cn.rst
regularizer_cn.rst
transpiler_cn.rst
dataset_cn.rst
data/dataset_cn.rst
data/data_reader_cn.rst
......@@ -12,7 +12,7 @@ cuda_profiler
.. py:function:: paddle.fluid.profiler.cuda_profiler(output_file, output_mode=None, config=None)
CUDA分析器。通过CUDA运行时应用程序编程接口对CUDA程序进行性能分析。分析结果将以键-值对格式或逗号分隔的格式写入output_file。用户可以通过output_mode参数设置输出模式,并通过配置参数设置计数器/选项。默认配置是[' gpustarttimestamp ', ' gpustarttimestamp ', ' gridsize3d ', ' threadblocksize ', ' streamid ', ' enableonstart 0 ', ' conckerneltrace ']。然后,用户可使用 `NVIDIA Visual Profiler <https://developer.nvidia.com/nvidia-visualprofiler>`_ 工具来加载这个输出文件以可视化结果。
CUDA分析器。通过CUDA运行时应用程序编程接口对CUDA程序进行性能分析。分析结果将以键-值对格式或逗号分隔的格式写入output_file。用户可以通过output_mode参数设置输出模式,并通过配置参数设置计数器/选项。默认配置是[' gpustarttimestamp ', ' gpustarttimestamp ', ' gridsize3d ', ' threadblocksize ', ' streamid ', ' enableonstart 0 ', ' conckerneltrace ']。然后,用户可使用 `NVIDIA Visual Profiler <https://developer.nvidia.com/nvidia-visual-profiler>`_ 工具来加载这个输出文件以可视化结果。
参数:
......@@ -28,7 +28,7 @@ CUDA分析器。通过CUDA运行时应用程序编程接口对CUDA程序进行
.. code-block:: python
import paddle.fluid as fluid
import paddle.fluid.profiler as profiler
......@@ -46,7 +46,7 @@ CUDA分析器。通过CUDA运行时应用程序编程接口对CUDA程序进行
for i in range(epoc):
input = np.random.random(dshape).astype('float32')
exe.run(fluid.default_main_program(), feed={'data': input})
# 之后可以使用 NVIDIA Visual Profile 可视化结果
......@@ -67,20 +67,20 @@ profiler
profile interface 。与cuda_profiler不同,此profiler可用于分析CPU和GPU程序。默认情况下,它记录CPU和GPU kernel,如果想分析其他程序,可以参考教程来在c++代码中添加更多代码。
如果 state== ' All ',在profile_path 中写入文件 profile proto 。该文件记录执行期间的时间顺序信息。然后用户可以看到这个文件的时间轴,请参考 `https://github.com/PaddlePaddle/Paddle/blob/develop/doc/fluid/howto/optimization/timeline.md <https://github.com/PaddlePaddle/Paddle/blob/develop/doc/fluid/howto/optimization/timeline.md>`_
如果 state== ' All ',在profile_path 中写入文件 profile proto 。该文件记录执行期间的时间顺序信息。然后用户可以看到这个文件的时间轴,请参考 `这里 <../advanced_usage/development/profiling/timeline_cn.html>`_
参数:
- **state** (string) – profiling state, 取值为 'CPU' 或 'GPU', profiler 使用 CPU timer 或GPU timer 进行 profiling. 虽然用户可能在开始时指定了执行位置(CPUPlace/CUDAPlace),但是为了灵活性,profiler不会使用这个位置。
- **sorted_key** (string) – 如果为None,prfile的结果将按照事件的第一次结束时间顺序打印。否则,结果将按标志排序。标志取值为"call"、"total"、"max"、"min" "ave"之一,根据调用着的数量进行排序。total表示按总执行时间排序,max 表示按最大执行时间排序。min 表示按最小执行时间排序。ave表示按平均执行时间排序。
- **profile_path** (string) – 如果 state == 'All', 结果将写入文件 profile proto.
抛出异常:
- ``ValueError`` – 如果state 取值不在 ['CPU', 'GPU', 'All']中. 如果 sorted_key 取值不在 ['calls', 'total', 'max', 'min', 'ave']
**代码示例**
.. code-block:: python
import paddle.fluid.profiler as profiler
with profiler.profiler('All', 'total', '/tmp/profile') as prof:
......@@ -110,7 +110,7 @@ reset_profiler
**代码示例**
.. code-block:: python
import paddle.fluid.profiler as profiler
with profiler.profiler(state, 'total', '/tmp/profile'):
for iter in range(10):
......@@ -133,10 +133,10 @@ start_profiler
.. py:function:: paddle.fluid.profiler.start_profiler(state)
激活使用 profiler, 用户可以使用 ``fluid.profiler.start_profiler`` 和 ``fluid.profiler.stop_profiler`` 插入代码
不能使用 ``fluid.profiler.profiler``
不能使用 ``fluid.profiler.profiler``
如果 state== ' All ',在profile_path 中写入文件 profile proto 。该文件记录执行期间的时间顺序信息。然后用户可以看到这个文件的时间轴,请参考 `https://github.com/PaddlePaddle/Paddle/blob/develop/doc/fluid/howto/optimization/timeline.md <https://github.com/PaddlePaddle/Paddle/blob/develop/doc/fluid/howto/optimization/timeline.md>`_
如果 state== ' All ',在profile_path 中写入文件 profile proto 。该文件记录执行期间的时间顺序信息。然后用户可以看到这个文件的时间轴,请参考 `这里 <../advanced_usage/development/profiling/timeline_cn.html>`_
参数:
- **state** (string) – profiling state, 取值为 'CPU' 或 'GPU' 或 'All', 'CPU' 代表只分析 cpu. 'GPU' 代表只分析 GPU . 'All' 会产生 timeline.
......@@ -147,7 +147,7 @@ start_profiler
**代码示例**
.. code-block:: python
import paddle.fluid.profiler as profiler
profiler.start_profiler('GPU')
......@@ -174,12 +174,12 @@ stop_profiler
.. py:function:: paddle.fluid.profiler.stop_profiler(sorted_key=None, profile_path='/tmp/profile')
停止 profiler, 用户可以使用 ``fluid.profiler.start_profiler`` 和 ``fluid.profiler.stop_profiler`` 插入代码
不能使用 ``fluid.profiler.profiler``
不能使用 ``fluid.profiler.profiler``
参数:
- **sorted_key** (string) – 如果为None,prfile的结果将按照事件的第一次结束时间顺序打印。否则,结果将按标志排序。标志取值为"call"、"total"、"max"、"min" "ave"之一,根据调用着的数量进行排序。total表示按总执行时间排序,max 表示按最大执行时间排序。min 表示按最小执行时间排序。ave表示按平均执行时间排序。
- **profile_path** (string) - 如果 state == 'All', 结果将写入文件 profile proto.
抛出异常:
- ``ValueError`` – 如果state 取值不在 ['CPU', 'GPU', 'All']中
......@@ -187,7 +187,7 @@ stop_profiler
**代码示例**
.. code-block:: python
import paddle.fluid.profiler as profiler
profiler.start_profiler('GPU')
......
===========
API快速检索
API分类检索
===========
API快速检索分功能向您介绍PaddlePaddle Fluid的API体系和用法,帮助您快速了解PaddlePaddle Fluid API的全貌,包括以下几个模块:
本模块分功能向您介绍PaddlePaddle Fluid的API体系和用法,提高您的查找效率,帮助您快速了解PaddlePaddle Fluid API的全貌,包括以下几个模块:
.. toctree::
:maxdepth: 1
......@@ -18,5 +18,6 @@ API快速检索分功能向您介绍PaddlePaddle Fluid的API体系和用法,
low_level/memory_optimize.rst
low_level/executor.rst
low_level/parallel_executor.rst
low_level/compiled_program.rst
low_level/parameter.rst
low_level/distributed/index.rst
......@@ -18,5 +18,6 @@ This section introduces the Fluid API structure and usage, to help you quickly g
low_level/memory_optimize_en.rst
low_level/executor_en.rst
low_level/parallel_executor_en.rst
low_level/compiled_program_en.rst
low_level/parameter_en.rst
low_level/distributed/index_en.rst
......@@ -4,7 +4,7 @@
分布式异步训练
############
Fluid支持数据并行的分布式异步训练,API使用 :code:`DistributedTranspiler` 将单机网络配置转换成可以多机执行的
Fluid支持数据并行的分布式异步训练,API使用 :code:`DistributeTranspiler` 将单机网络配置转换成可以多机执行的
:code:`pserver` 端程序和 :code:`trainer` 端程序。用户在不同的节点执行相同的一段代码,根据环境变量或启动参数,
可以执行对应的 :code:`pserver` 或 :code:`trainer` 角色。Fluid异步训练只支持pserver模式,异步训练和 `同步训练 <../distributed/sync_training.html>`_ 的主要差异在于:异步训练每个trainer的梯度是单独更新到参数上的,
而同步训练是所有trainer的梯度合并之后统一更新到参数上,因此,同步训练和异步训练的超参数需要分别调节。
......@@ -16,10 +16,10 @@ API详细使用方法参考 :ref:`cn_api_fluid_DistributeTranspiler` ,简单
.. code-block:: python
config = fluid.DistributedTranspilerConfig()
config = fluid.DistributeTranspilerConfig()
# 配置策略config
config.slice_var_up = False
t = fluid.DistributedTranspiler(config=config)
t = fluid.DistributeTranspiler(config=config)
t.transpile(trainer_id,
program=main_program,
pservers="192.168.0.1:6174,192.168.0.2:6174",
......
......@@ -4,11 +4,11 @@
执行引擎
##########
:code:`Executor` 实现了一个简易的执行器,所有的操作在其中顺序执行。你可以在Python脚本中运行:code:`Executor`。PaddlePaddle Fluid中有两种执行器。一种是:code:`Executor` 默认的单线程执行器,另一种是并行计算执行器,在:ref:`api_guide_parallel_executor`中进行了解释。`Executor`和:ref:`api_guide_parallel_executor`的配置不同,这可能会给部分用户带来困惑。为使执行器更加灵活,我们引入了:ref:`api_guide_compiled_program`,:ref:`api_guide_compiled_program`用于把一个程序转换为不同的优化组合,可以通过:code:`Executor`运行。
:code:`Executor` 实现了一个简易的执行器,所有的操作在其中顺序执行。你可以在Python脚本中运行 :code:`Executor` 。PaddlePaddle Fluid中有两种执行器。一种是 :code:`Executor` 默认的单线程执行器,另一种是并行计算执行器,在 :ref:`api_guide_parallel_executor` 中进行了解释。``Executor`` 和 :ref:`api_guide_parallel_executor` 的配置不同,这可能会给部分用户带来困惑。为使执行器更加灵活,我们引入了 :ref:`api_guide_compiled_program` , :ref:`api_guide_compiled_program` 用于把一个程序转换为不同的优化组合,可以通过 :code:`Executor` 运行。
:code:`Executor`的逻辑非常简单。建议在调试阶段用:code:`Executor`在一台计算机上完整地运行模型,然后转向多设备或多台计算机计算。
:code:`Executor` 的逻辑非常简单。建议在调试阶段用 :code:`Executor` 在一台计算机上完整地运行模型,然后转向多设备或多台计算机计算。
:code:`Executor`在构造时接受一个:code:`Place`,它既可能是:ref:`api_fluid_CPUPlace`也可能是:ref:`api_fluid_CUDAPlace`
:code:`Executor` 在构造时接受一个 :code:`Place` ,它既可能是 :ref:`api_fluid_CPUPlace` 也可能是 :ref:`api_fluid_CUDAPlace`
.. code-block:: python
# 首先创建Executor。
......@@ -16,12 +16,12 @@
exe = fluid.Executor(place)
# 运行启动程序仅一次。
exe.run(fluid.default_startup_program())
# 直接运行主程序。
loss, = exe.run(fluid.default_main_program(),
feed=feed_dict,
fetch_list=[loss.name])
简单样例请参照 `quick_start_fit_a_line <http://paddlepaddle.org/documentation/docs/zh/1.1/beginners_guide/quick_start/fit_a_line/README.html>`_
简单样例请参照 `basics_fit_a_line <../../beginners_guide/basics/fit_a_line/README.cn.html>`_
- 相关API :
- :ref:`cn_api_fluid_Executor`
- :ref:`cn_api_fluid_Executor`
......@@ -8,7 +8,7 @@ Executor
The logic of :code:`Executor` is very simple. It is suggested to thoroughly run the model with :code:`Executor` in debugging phase on one computer and then switch to mode of multiple devices or multiple computers to compute.
:code:`Executor` receives a :code:`Place` at construction, which can either be :ref:`api_fluid_CPUPlace` or :ref:`api_fluid_CUDAPlace`.
:code:`Executor` receives a :code:`Place` at construction, which can either be :ref:`api_fluid_CPUPlace` or :ref:`api_fluid_CUDAPlace`.
.. code-block:: python
......@@ -18,14 +18,14 @@ The logic of :code:`Executor` is very simple. It is suggested to thoroughly run
# Run the startup program once and only once.
exe.run(fluid.default_startup_program())
# Run the main program directly.
loss, = exe.run(fluid.default_main_program(),
feed=feed_dict,
fetch_list=[loss.name])
For simple example please refer to `quick_start_fit_a_line <http://paddlepaddle.org/documentation/docs/zh/1.1/beginners_guide/quick_start/fit_a_line/README.html>`_
For simple example please refer to `basics_fit_a_line <../../beginners_guide/basics/fit_a_line/README.html>`_
- Related API :
- :ref:`api_fluid_Executor`
......
......@@ -14,30 +14,31 @@
---------------------
卷积需要依据滑动步长(stride)、填充长度(padding)、卷积核窗口大小(filter size)、分组数(groups)、扩张系数(dilation rate)来决定如何计算。groups最早在 `AlexNet <https://www.nvidia.cn/content/tesla/pdf/machine-learning/imagenet-classification-with-deep-convolutional-nn.pdf>`_ 中引入, 可以理解为将原始的卷积分为独立若干组卷积计算。
**注意**: 同cuDNN的方式,Fluid目前只支持在特征图上下填充相同的长度,左右也是。
- 输入输出Layout:
- 输入输出Layout:
2D卷积输入特征的Layout为[N, C, H, W]或[N, H, W, C], N即batch size,C是通道数,H、W是特征的高度和宽度,输出特征和输入特征的Layout一致。(相应的3D卷积输入特征的Layout为[N, C, D, H, W]或[N, D, H, W, C],但**注意**,Fluid的卷积当前只支持[N, C, H, W],[N, C, D, H, W]。)
- 卷积核的Layout:
- 卷积核的Layout:
Fluid中2D卷积的卷积核(也称权重)的Layout为[C_o, C_in / groups, f_h, f_w],C_o、C_in表示输出、输入通道数,f_h、f_w表示卷积核窗口的高度和宽度,按行序存储。(相应的2D卷积的卷积核Layout为[C_o, C_in / groups, f_d, f_h, d_w],同样按行序存储。)
- 深度可分离卷积(depthwise separable convolution):
- 深度可分离卷积(depthwise separable convolution):
在深度可分离卷积中包括depthwise convolution和pointwise convolution两组,这两个卷积的接口和上述普通卷积接口相同。前者可以通过给普通卷积设置groups来做,后者通过设置卷积核filters的大小为1x1,深度可分离卷积减少参数的同时减少了计算量。
对于depthwise convolution,可以设置groups等于输入通道数,此时,2D卷积的卷积核形状为[C_o, 1, f_h, f_w]。
对于pointwise convolution,卷积核的形状为[C_o, C_in, 1, 1]。
**注意**:Fluid针对depthwise convolution的GPU计算做了高度优化,您可以通过在 :code:`fluid.layers.conv2d`接口设置 :code:`use_cudnn=False`来使用Fluid自身优化的CUDA程序。
**注意**:Fluid针对depthwise convolution的GPU计算做了高度优化,您可以通过在
:code:`fluid.layers.conv2d` 接口设置 :code:`use_cudnn=False` 来使用Fluid自身优化的CUDA程序。
- 空洞卷积(dilated convolution):
空洞卷积相比普通卷积而言,卷积核在特征图上取值时不在连续,而是间隔的,这个间隔数称作dilation,等于1时,即为普通卷积,空洞卷积相比普通卷积的感受野更大。
- API汇总:
- :ref:`cn_api_fluid_layers_conv2d`
- :ref:`cn_api_fluid_layers_conv3d`
......@@ -50,14 +51,14 @@
Fluid可以表示变长的序列结构,这里的变长是指不同样本的时间步(step)数不一样,通常是一个2D的Tensor和一个能够区分的样本长度的辅助结构来表示。假定,2D的Tensor的形状是shape,shape[0]是所有样本的总时间步数,shape[1]是序列特征的大小。
基于此数据结构的卷积在Fluid里称作序列卷积,也表示一维卷积。同图像卷积,序列卷积的输入参数有卷积核大小、填充大小、滑动步长,但与2D卷积不同的是,这些参数个数都为1。**注意**,目前仅支持stride为1的情况,输出序列的时间步数和输入序列相同。
基于此数据结构的卷积在Fluid里称作序列卷积,也表示一维卷积。同图像卷积,序列卷积的输入参数有卷积核大小、填充大小、滑动步长,但与2D卷积不同的是,这些参数个数都为1。**注意**,目前仅支持stride为1的情况,输出序列的时间步数和输入序列相同。
假如:输入序列形状为(T, N), T即该序列的时间步数,N是序列特征大小;卷积核的上下文步长为K,输出序列长度为M,则卷积核权重形状为(K * N, M),输出序列形状为(T, M)。
另外,参考DeepSpeech,Fluid实现了行卷积row convolution, 或称
`look ahead convolution <http://www.cs.cmu.edu/~dyogatam/papers/wang+etal.iclrworkshop2016.pdf>`_ ,
该卷积相比上述普通序列卷积可以减少参数。
- API汇总:
- :ref:`cn_api_fluid_layers_sequence_conv`
......
......@@ -37,9 +37,9 @@ API详细使用方法参考 :ref:`cn_api_fluid_layers_embedding` ,以下是一
以上参数中:
- :code:`is_sparse` : 反向计算的时候梯度是否为sparse tensor。如果不设置,梯度是一个 `LodTensor <https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/user_guides/howto/prepare_data/lod_tensor.md>`_ 。默认为False。
- :code:`is_sparse` : 反向计算的时候梯度是否为sparse tensor。如果不设置,梯度是一个 `LodTensor <https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/user_guides/howto/basic_concept/lod_tensor.html>`_ 。默认为False。
- :code:`is_distributed` : 标志是否是用在分布式的场景下。一般大规模稀疏更新(embedding的第0维维度很大,比如几百万以上)才需要设置。具体可以参考大规模稀疏的API guide :ref:`api_guide_async_training` 。默认为False。
- :code:`is_distributed` : 标志是否是用在分布式的场景下。一般大规模稀疏更新(embedding的第0维维度很大,比如几百万以上)才需要设置。具体可以参考大规模稀疏的API guide :ref:`cn_api_guide_async_training` 。默认为False。
- API汇总:
- :ref:`cn_api_fluid_layers_embedding`
......@@ -37,9 +37,9 @@ API reference :ref:`api_fluid_layers_embedding` . Here is a simple example:
The parameters:
- :code:`is_sparse` : Whether the gradient is a sparse tensor in the backward calculation. If not set, the gradient is a `LodTensor <https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/user_guides/howto/prepare_data/lod_tensor.md>`_ . The default is False.
- :code:`is_sparse` : Whether the gradient is a sparse tensor in the backward calculation. If not set, the gradient is a `LodTensor <https://github.com/PaddlePaddle/FluidDoc/blob/develop/doc/fluid/user_guides/howto/basic_concept/lod_tensor_en.html>`_ . The default is False.
- :code:`is_distributed` : Whether the current training is in a distributed scenario. Generally, this parameter can only be set in large-scale sparse updates (the 0th dimension of embedding is very large, such as several million or more). For details, please refer to the large-scale sparse API guide :ref:`api_guide_async_training`. The default is False.
- API :
- :ref:`api_fluid_layers_embedding`
\ No newline at end of file
- :ref:`api_fluid_layers_embedding`
......@@ -33,8 +33,9 @@ API Reference 请参考 :ref:`cn_api_fluid_nets_img_conv_group`
:code:`sequence_conv_pool` 是由 :ref:`cn_api_fluid_layers_sequence_conv` 与 :ref:`cn_api_fluid_layers_sequence_pool` 串联而成。
该模块在 `自然语言处理 <https://zh.wikipedia.org/wiki/自然语言处理>`_ 以及 `语音识别 <https://zh.wikipedia.org/wiki/语音识别>`_ 等领域均有广泛应用,
比如 `文本分类模型 <https://github.com/PaddlePaddle/models/blob/develop/fluid/PaddleNLP/text_classification/nets.py>`_ ,
`TagSpace <https://github.com/PaddlePaddle/models/blob/develop/fluid/PaddleRec/tagspace/train.py>`_ 以及 `Multi-view Simnet <https://github.com/PaddlePaddle/models/blob/develop/fluid/PaddleRec/multiview_simnet/nets.py>`_ 等模型。
比如 `文本分类模型 <https://github.com/PaddlePaddle/models/blob/develop/PaddleNLP/text_classification/nets.py>`_ ,
`TagSpace <https://github.com/PaddlePaddle/models/blob/develop/PaddleRec/tagspace/train.py>`_ 以及
`Multi-view Simnet <https://github.com/PaddlePaddle/models/blob/develop/PaddleRec/multiview_simnet/nets.py>`_ 等模型。
API Reference 请参考 :ref:`cn_api_fluid_nets_sequence_conv_pool`
......@@ -55,7 +56,7 @@ API Reference 请参考 :ref:`cn_api_fluid_nets_glu`
.. math::
Attention(Q, K, V)= softmax(QK^\mathrm{T})V
该模块广泛使用在 `机器翻译 <https://zh.wikipedia.org/zh/机器翻译>`_ 的模型中,比如 `Transformer <https://github.com/PaddlePaddle/models/tree/develop/fluid/PaddleNLP/neural_machine_translation/transformer>`_ 。
该模块广泛使用在 `机器翻译 <https://zh.wikipedia.org/zh/机器翻译>`_ 的模型中,比如 `Transformer <https://github.com/PaddlePaddle/models/tree/develop/PaddleNLP/neural_machine_translation/transformer>`_ 。
API Reference 请参考 :ref:`cn_api_fluid_nets_scaled_dot_product_attention`
......@@ -32,8 +32,8 @@ For API Reference, please refer to :ref:`api_fluid_nets_img_conv_group`
--------------------
:code:`sequence_conv_pool` is got by concatenating :ref:`api_fluid_layers_sequence_conv` with :ref:`api_fluid_layers_sequence_pool`.
The module is widely used in the field of `natural language processing <https://en.wikipedia.org/wiki/Natural_language_processing>`_ and `speech recognition <https://en.wikipedia.org/wiki/Speech_recognition>`_ . Models such as the `text classification model <https://github.com/PaddlePaddle/models/blob/develop/fluid/PaddleNLP/text_classification/nets.py>`_ ,
`TagSpace <https://github.com/PaddlePaddle/models/blob/develop/fluid/PaddleRec/tagspace/train.py>`_ and `Multi view Simnet <https://github.com/PaddlePaddle/models/blob/develop/fluid/PaddleRec/multiview_simnet/nets.py>`_.
The module is widely used in the field of `natural language processing <https://en.wikipedia.org/wiki/Natural_language_processing>`_ and `speech recognition <https://en.wikipedia.org/wiki/Speech_recognition>`_ . Models such as the `text classification model <https://github.com/PaddlePaddle/models/blob/develop/PaddleNLP/text_classification/nets.py>`_ ,
`TagSpace <https://github.com/PaddlePaddle/models/blob/develop/PaddleRec/tagspace/train.py>`_ and `Multi view Simnet <https://github.com/PaddlePaddle/models/blob/develop/PaddleRec/multiview_simnet/nets.py>`_.
For API Reference, please refer to :ref:`api_fluid_nets_sequence_conv_pool`
......@@ -54,6 +54,6 @@ For the input data :code:`Queries` , :code:`Key` and :code:`Values`, calculate t
.. math::
Attention(Q, K, V)= softmax(QK^\mathrm{T})V
This module is widely used in the model of `machine translation <https://en.wikipedia.org/wiki/Machine_translation>`_, such as `Transformer <https://github.com/PaddlePaddle/models/tree/develop/Fluid/PaddleNLP/neural_machine_translation/transformer>`_ .
This module is widely used in the model of `machine translation <https://en.wikipedia.org/wiki/Machine_translation>`_, such as `Transformer <https://github.com/PaddlePaddle/models/tree/develop/PaddleNLP/neural_machine_translation/transformer>`_ .
For API Reference, please refer to :ref:`api_fluid_nets_scaled_dot_product_attention`
......@@ -29,7 +29,7 @@
**注意** :如果在Reduce模式下使用 :code:`CPU` 多线程执行 :code:`Program` , :code:`Program` 的参数在多个线程间是共享的,在某些模型上,Reduce模式可以大幅节省内存。
鉴于模型的执行速率和模型结构及执行器的执行策略有关,:code:`ParallelExecutor` 允许你修改执行器的相关参数,例如线程池的规模( :code:`num_threads` )、为清除临时变量:code:`num_iteration_per_drop_scope`需要进行的循环次数。更多信息请参照:ref:`cn_api_fluid_ExecutionStrategy`
鉴于模型的执行速率和模型结构及执行器的执行策略有关,:code:`ParallelExecutor` 允许你修改执行器的相关参数,例如线程池的规模( :code:`num_threads` )、为清除临时变量 :code:`num_iteration_per_drop_scope` 需要进行的循环次数。更多信息请参照 :ref:`cn_api_fluid_ExecutionStrategy`
.. code-block:: python
......@@ -49,8 +49,8 @@
exec_strategy.num_threads = dev_count * 4 # the size of thread pool.
build_strategy = fluid.BuildStrategy()
build_strategy.memory_optimize = True if memory_opt else False
train_exe = fluid.ParallelExecutor(use_cuda=use_cuda,
main_program=train_program,
train_exe = fluid.ParallelExecutor(use_cuda=use_cuda,
main_program=train_program,
build_strategy=build_strategy,
exec_strategy=exec_strategy,
loss_name=loss.name)
......
################
深度学习基础
深度学习基础教程
################
本章由7篇文档组成,它们按照简单到难的顺序排列,将指导您如何使用PaddlePaddle完成基础的深度学习任务
本章由9篇文档组成,它们按照简单到难的顺序排列,将指导您如何使用PaddlePaddle完成基础的深度学习任务
本章文档涉及大量了深度学习基础知识,也介绍了如何使用PaddlePaddle实现这些内容,请参阅以下说明了解如何使用:
......@@ -15,6 +15,8 @@
.. toctree::
:titlesonly:
fit_a_line/README.cn.md
recognize_digits/README.cn.md
image_classification/index.md
word2vec/index.md
recommender_system/index.md
......
##########################
############################
Basic Deep Learning Models
##########################
############################
This section collects six documents arranging from the simplest to the most challenging, which will guide you through the basic deep learning tasks in PaddlePaddle.
This section collects 8 documents arranging from the simplest to the most challenging, which will guide you through the basic deep learning tasks in PaddlePaddle.
The documentation in this chapter covers a lot of deep learning basics and how to implement them with PaddlePaddle. See the instructions below for how to use:
......@@ -15,6 +15,8 @@ The book you are reading is an "interactive" e-book - each chapter can be run in
.. toctree::
:titlesonly:
fit_a_line/README.md
recognize_digits/README.md
image_classification/index_en.md
word2vec/index_en.md
recommender_system/index_en.md
......@@ -45,7 +47,7 @@ Just run these in shell:
docker run -d -p 8888:8888 paddlepaddle/book
It downloads the Docker image for running books from DockerHub.com.
It downloads the Docker image for running books from DockerHub.com.
To read and edit this book on-line, please visit http://localhost:8888 in your browser.
If the Internet connection to DockerHub.com is compromised, try our spare docker image named docker.paddlepaddlehub.com:
......
......@@ -6,23 +6,24 @@ PaddlePaddle (PArallel Distributed Deep LEarning)是一个易用、高效、灵
您可参考PaddlePaddle的 `Github <https://github.com/PaddlePaddle/Paddle>`_ 了解详情,也可阅读 `版本说明 <../release_note.html>`_ 了解新版本的特性
当您第一次来到PaddlePaddle,请您首先阅读以下文档,了解安装方法
让我们从这里开始
- `安装说明 <../beginners_guide/install/index_cn.html>`_:我们支持在Ubuntu/CentOS/Windows/MacOS环境上的安装
- `快速开始 <../beginners_guide/quick_start.html>`_
如果您已经具备一定的深度学习基础,第一次使用PaddlePaddle时,可以跟随下列简单的模型案例供您快速上手
当您第一次来到PaddlePaddle,请您首先阅读以下文档,了解安装方法
- `Fluid编程指南 <../beginners_guide/programming_guide/programming_guide.html>`_:介绍 Fluid 的基本概念和使用方法
- `安装说明 <../beginners_guide/install/index_cn.html>`_:我们支持在Ubuntu/CentOS/Windows/MacOS环境上的安装
- `快速入门 <../beginners_guide/quick_start/index.html>`_:提供线性回归和识别数字两个入门级模型,帮助您快速上手训练网络
这里为您提供了更多学习资料:
- `深度学习基础 <../beginners_guide/basics/index.html>`_:覆盖图像分类、个性化推荐、机器翻译等多个深度领域的基础知识,提供 Fluid 实现案例
- `Fluid编程指南 <../beginners_guide/programming_guide/programming_guide.html>`_:介绍 Fluid 的基本概念和使用方法
.. toctree::
:hidden:
quick_start_cn.rst
install/index_cn.rst
quick_start/index.rst
basics/index.rst
basics/index_cn.rst
programming_guide/programming_guide.md
......@@ -15,8 +15,6 @@ If you have been armed with certain level of deep learning knowledge, and it hap
- `Programming with Fluid <../beginners_guide/programming_guide/programming_guide_en.html>`_ : Core concepts and basic usage of Fluid
- `Quick Start <../beginners_guide/quick_start/index_en.html>`_: Two easy-to-go models, linear regression model and digit recognition model, are in place to speed up your study of training neural networks
- `Deep Learning Basics <../beginners_guide/basics/index_en.html>`_: This section encompasses various fields of fundamental deep learning knowledge, such as image classification, customized recommendation, machine translation, and examples implemented by Fluid are provided.
......@@ -24,6 +22,5 @@ If you have been armed with certain level of deep learning knowledge, and it hap
:hidden:
install/index_en.rst
quick_start/index_en.rst
basics/index_en.rst
programming_guide/programming_guide_en.md
......@@ -68,7 +68,7 @@ Once you have **properly installed Docker**, you can start **compiling PaddlePad
9. Execute cmake:
> For details on the compilation options, see the [compilation options table](../Tables.html/#Compile).
> For details on the compilation options, see the [compilation options table](../Tables_en.html/#Compile).
* For users who need to compile the **CPU version PaddlePaddle**:
......
......@@ -4,7 +4,7 @@
This instruction describes how to install PaddlePaddle on a *64-bit desktop or laptop* and Ubuntu system. The Ubuntu systems we support must meet the following requirements:
Please note: Attempts on other systems may cause the installation to fail. Please ensure that your environment meets the conditions. The installation we provide by default requires your computer processor to support the AVX instruction set. Otherwise, please select the version of `no_avx` in the [latest Release installation package list](./Tables.html/#ciwhls-release).
Please note: Attempts on other systems may cause the installation to fail. Please ensure that your environment meets the conditions. The installation we provide by default requires your computer processor to support the AVX instruction set. Otherwise, please select the version of `no_avx` in the [latest Release installation package list](./Tables_en.html/#ciwhls-release).
Under Ubuntu, you can use `cat /proc/cpuinfo | grep avx` to check if your processor supports the AVX instruction set.
......@@ -80,9 +80,9 @@ Now let's install PaddlePaddle:
* For users who need **the GPU version PaddlePaddle**: `pip install paddlepaddle-gpu` or `pip3 install paddlepaddle-gpu`
> 1.In order to prevent problem "nccl.h cannot be found", please first install nccl2 according to the following command (here is ubuntu 16.04, CUDA9, ncDNN v7 nccl2 installation instructions), for more information about the installation information, please refer to [the NVIDIA official website](https://developer.nvidia.com/nccl/nccl-download):
i. `Wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/nvidia-machine-learning-repo-ubuntu1604_1.0.0-1_amd64.deb`
ii. `dpkg -i nvidia-machine- Learning-repo-ubuntu1604_1.0.0-1_amd64.deb`
ii. `dpkg -i nvidia-machine- Learning-repo-ubuntu1604_1.0.0-1_amd64.deb`
iii. `sudo apt-get install -y libnccl2=2.2.13-1+cuda9.0 libnccl-dev=2.2.13-1+cuda9.0`
> 2.If you do not specify the pypi package version number, we will by default provide you with a version of PaddlePaddle that supports Cuda 9/cuDNN v7.
......
......@@ -407,17 +407,17 @@ outs = exe.run(
```
可以看到100次迭代后,预测值已经非常接近真实值了,损失值也从初始值9.05下降到了0.01。
恭喜您!已经成功完成了第一个简单网络的搭建,想尝试线性回归的进阶版——房价预测模型,请阅读:[线性回归](../../beginners_guide/quick_start/fit_a_line/README.cn.html)。更多丰富的模型实例可以在[模型库](../../user_guides/models/index_cn.html)中找到。
恭喜您!已经成功完成了第一个简单网络的搭建,想尝试线性回归的进阶版——房价预测模型,请阅读:[线性回归](../../beginners_guide/basics/fit_a_line/README.cn.html)。更多丰富的模型实例可以在[模型库](../../user_guides/models/index_cn.html)中找到。
<a name="what_next"></a>
## What's next
如果您已经掌握了基本操作,可以进行下一阶段的学习了:
跟随这一教程将学习到如何对实际问题建模并使用fluid构建模型:[配置简单的网络](../../user_guides/howto/configure_simple_model/index.html)
跟随这一教程将学习到如何对实际问题建模并使用fluid构建模型:[配置简单的网络](../../user_guides/howto/configure_simple_model/index_cn.html)
完成网络搭建后,可以开始在单机或多机上训练您的网络了,详细步骤请参考[训练神经网络](../../user_guides/howto/training/index.html)
完成网络搭建后,可以开始在单机或多机上训练您的网络了,详细步骤请参考[训练神经网络](../../user_guides/howto/training/index_cn.html)
除此之外,使用文档模块根据开发者的不同背景划分了三个学习阶段:[新手入门](../../beginners_guide/index.html)[使用指南](../../user_guides/index.html)[进阶使用](../../advanced_usage/index.html)
除此之外,使用文档模块根据开发者的不同背景划分了三个学习阶段:[新手入门](../../beginners_guide/index_cn.html)[使用指南](../../user_guides/index_cn.html)[进阶使用](../../advanced_usage/index_cn.html)
如果您希望阅读更多场景下的应用案例,可以跟随导航栏进入[快速入门](../../beginners_guide/quick_start/index.html)[深度学习基础知识](../../beginners_guide/basics/index.html)。已经具备深度学习基础知识的用户,可以从[使用指南](../../user_guides/index.html)开始阅读。
如果您希望阅读更多场景下的应用案例,可以参考[深度学习基础教程](../../beginners_guide/basics/index_cn.html)。已经具备深度学习基础知识的用户,可以从[使用指南](../../user_guides/index_cn.html)开始阅读。
......@@ -414,7 +414,7 @@ Firstly, define input data format, model structure,loss function and optimized a
```
Now we discover that predicted value is nearly close to real value and the loss value descends from original value 9.05 to 0.01 after iteration for 100 times.
Congratulations! You have succeed to create a simple network. If you want to try advanced linear regression —— predict model of housing price, please read [linear regression](../../beginners_guide/quick_start/fit_a_line/README.en.html). More examples of model can be found in [models](../../user_guides/models/index_en.html).
Congratulations! You have succeed to create a simple network. If you want to try advanced linear regression —— predict model of housing price, please read [linear regression](../../beginners_guide/basics/fit_a_line/README.en.html). More examples of model can be found in [models](../../user_guides/models/index_en.html).
<a name="what_next"></a>
## What's next
......@@ -427,4 +427,4 @@ After the construction of network, you can start training your network in single
In addition, there are three learning levels in documentation according to developer's background and experience: [Beginner's Guide](../../beginners_guide/index_en.html) , [User Guides](../../user_guides/index_en.html) and [Advanced User Guides](../../advanced_usage/index_en.html).
If you want to read examples in more application scenarios, you can go to [quick start](../../beginners_guide/quick_start/index_en.html) and [basic knowledge of deep learning](../../beginners_guide/basics/index_en.html) .If you have learned basic knowledge of deep learning, you can read from [user guide](../../user_guides/index_en.html).
If you want to read examples in more application scenarios, you can go to [basic knowledge of deep learning](../../beginners_guide/basics/index_en.html) .If you have learned basic knowledge of deep learning, you can read from [user guide](../../user_guides/index_en.html).
########
快速入门
########
欢迎来到快速入门部分,在这里,我们将向您介绍如何通过PaddlePaddle Fluid实现经典的线性回归和手写识别的模型,以下两篇文档将指导您使用真实数据集搭建起模型、进行训练和预测:
.. toctree::
:titlesonly:
fit_a_line/README.cn.md
recognize_digits/README.cn.md
##############
Quick Start
##############
Welcome to Quick Start!
This section will tutor you to invent your won models of classical *linear Regression* and *Handwritten Digits Recognition* tasks in PaddlePaddle Fluid. The following tutorials provide details on model definition, training, and inference in a friendly manner based on real-life datasets:
.. toctree::
:titlesonly:
fit_a_line/README.md
recognize_digits/README.md
......@@ -11,8 +11,8 @@
:maxdepth: 1
beginners_guide/index.rst
user_guides/index.rst
advanced_usage/index.rst
beginners_guide/index_cn.rst
user_guides/index_cn.rst
advanced_usage/index_cn.rst
api_cn/index_cn.rst
release_note.rst
release_note_cn.rst
.. _deploy_ctr_on_baidu_cloud_cn:
百度云分布式训练CTR
百度云分布式训练CTR
=========================
Fluid支持数据并行的分布式训练,也支持基于Kubernetes的分布式部署。本文以百度云为例,说明如何通过在云服务器上分布式训练Click-Through-Rate(以下简称ctr)任务。
......
......@@ -7,6 +7,6 @@ PaddlePaddle Fluid支持单机训练和多节点训练。每种训练模式下
.. toctree::
:maxdepth: 1
single_node
multi_node
save_load_variables
single_node.rst
multi_node.rst
save_load_variables.rst
......@@ -2,9 +2,10 @@
多机训练
########
.. toctree::
:maxdepth: 1
.. toctree::
:maxdepth: 1
cluster_quick_start.rst
cluster_howto.rst
train_on_baidu_cloud_cn.rst
cluster_quick_start.rst
cluster_howto.rst
train_on_baidu_cloud_cn.rst
deploy_ctr_on_baidu_cloud_cn.rst
.. _user_guide_save_load_vars:
##################
模型/变量的保存载入与增量训练
##################
#############################
模型/变量的保存/载入与增量训练
#############################
模型变量分类
############
......@@ -69,7 +69,7 @@
载入模型用于对新样本的预测
==========================
对于通过 :code:`fluid.io.save_params` 保存的模型,可以使用 :code:`fluid.io.load_params`
对于通过 :code:`fluid.io.save_params` 保存的模型,可以使用 :code:`fluid.io.load_params`
来进行载入。
例如:
......@@ -149,7 +149,7 @@
fluid.io.load_persistables(exe, path, startup_prog)
main_prog = fluid.default_main_program()
exe.run(main_prog)
上面的例子中,通过调用 :code:`fluid.io.load_persistables` 函数,PaddlePaddle Fluid会从默认
:code:`fluid.Program` 也就是 :code:`prog` 的所有模型变量中找出长期变量,从指定的 :code:`path` 目录中将它们一一加载, 然后再继续进行训练。
......
......@@ -77,25 +77,25 @@
多卡训练
#######################
在多卡训练中,你可以使用:code:`fluid.compiler.CompiledProgram`来编译:code:`fluid.Program`,然后调用:code:`with_data_parallel`。例如:
在多卡训练中,你可以使用 :code:`fluid.compiler.CompiledProgram` 来编译 :code:`fluid.Program` ,然后调用 :code:`with_data_parallel` 。例如:
.. code-block:: python
exe = fluid.Executor(...)
compiled_prog = fluid.compiler.CompiledProgram(
fluid.default_main_program()).with_data_parallel(
loss_name=loss.name)
result = exe.run(program=compiled_prog,
fetch_list=[loss.name],
feed={"image": ..., "label": ...})
result = exe.run(program=compiled_prog,
fetch_list=[loss.name],
feed={"image": ..., "label": ...})
注释:
1. :ref:`cn_api_fluid_CompiledProgram`的构造函数需要经过:code:`fluid.Program`设置后运行,这在运行时内无法被修改。
2. 如果:code:`exe`是用CUDAPlace来初始化的,模型会在GPU中运行。在显卡训练模式中,所有的显卡都将被占用。用户可以配置 `CUDA_VISIBLE_DEVICES <http://www.acceleware.com/blog/cudavisibledevices-masking-gpus>`_ 以更改被占用的显卡。
3. 如果:code:`exe`是用CPUPlace来初始化的,模型会在CPU中运行。在这种情况下,多线程用于运行模型,同时线程的数目和逻辑核的数目相等。用户可以配置`CPU_NUM`以更改使用中的线程数目。
1. :ref:`cn_api_fluid_CompiledProgram` 的构造函数需要经过 :code:`fluid.Program` 设置后运行,这在运行时内无法被修改。
2. 如果 :code:`exe` 是用CUDAPlace来初始化的,模型会在GPU中运行。在显卡训练模式中,所有的显卡都将被占用。用户可以配置 `CUDA_VISIBLE_DEVICES <http://www.acceleware.com/blog/cudavisibledevices-masking-gpus>`_ 以更改被占用的显卡。
3. 如果 :code:`exe` 是用CPUPlace来初始化的,模型会在CPU中运行。在这种情况下,多线程用于运行模型,同时线程的数目和逻辑核的数目相等。用户可以配置 ``CPU_NUM`` 以更改使用中的线程数目。
进阶使用
###############
......
.. _train_on_baidu_cloud_cn:
在百度云启动Fluid分布式训练
在百度云启动分布式训练
=========================
PaddlePaddle Fluid分布式训练,可以不依赖集群系统(比如MPI,Kubernetes)启动分布式训练。
......
......@@ -8,13 +8,13 @@
- `基本概念 <../user_guides/howto/basic_concept/index_cn.html>`_ :介绍了Fluid的基本使用概念
- `准备数据 <../user_guides/howto/prepare_data/index.html>`_ :介绍使用 Fluid 训练网络时,数据的支持类型及传输方法
- `准备数据 <../user_guides/howto/prepare_data/index_cn.html>`_ :介绍使用 Fluid 训练网络时,数据的支持类型及传输方法
- `配置简单的网络 <../user_guides/howto/configure_simple_model/index.html>`_: 介绍如何针对问题建模,并利用 Fluid 中相关算子搭建网络
- `配置简单的网络 <../user_guides/howto/configure_simple_model/index_cn.html>`_: 介绍如何针对问题建模,并利用 Fluid 中相关算子搭建网络
- `训练神经网络 <../user_guides/howto/training/index.html>`_:介绍如何使用 Fluid 进行单机训练、多机训练、以及保存和载入模型变量
- `训练神经网络 <../user_guides/howto/training/index_cn.html>`_:介绍如何使用 Fluid 进行单机训练、多机训练、以及保存和载入模型变量
- `模型评估与调试 <../user_guides/howto/evaluation_and_debugging/index.html>`_:介绍在 Fluid 下进行模型评估和调试的方法,包括:
- `模型评估与调试 <../user_guides/howto/evaluation_and_debugging/index_cn.html>`_:介绍在 Fluid 下进行模型评估和调试的方法,包括:
基于 Fluid 复现的多领域经典模型:
......@@ -24,8 +24,8 @@
:hidden:
howto/basic_concept/index_cn.rst
howto/prepare_data/index
howto/configure_simple_model/index
howto/training/index
howto/evaluation_and_debugging/index
howto/prepare_data/index_cn.rst
howto/configure_simple_model/index_cn.rst
howto/training/index_cn.rst
howto/evaluation_and_debugging/index_cn.rst
models/index_cn.rst
......@@ -87,7 +87,7 @@ Automatic Speech Recognition (ASR) is a technique for transcribing vocabulary co
Different from the end-to-end direct prediction for word distribution of the deep learning model `DeepSpeech <https://github.com/PaddlePaddle/DeepSpeech>`__ , this example is closer to the traditional language recognition process. With phoneme as the modeling unit, it focuses on the training of acoustic models in speech recognition, use `kaldi <http://www.kaldi-asr.org>`__ for feature extraction and label alignment of audio data, and integrate kaldi's decoder to complete decoding.
- `DeepASR <https://github.com/PaddlePaddle/models/blob/develop/DeepASR/README_cn.md>`__
- `DeepASR <https://github.com/PaddlePaddle/models/blob/develop/PaddleSpeech/DeepASR/README.md>`__
Machine Translation
---------------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册