Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
c99a8742
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c99a8742
编写于
6月 12, 2017
作者:
T
Travis CI
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deploy to GitHub Pages:
1b8d2e65
上级
1afebc51
变更
6
展开全部
显示空白变更内容
内联
并排
Showing
6 changed file
with
224 addition
and
2 deletion
+224
-2
develop/doc/_sources/api/v2/config/layer.rst.txt
develop/doc/_sources/api/v2/config/layer.rst.txt
+11
-0
develop/doc/api/v2/config/layer.html
develop/doc/api/v2/config/layer.html
+100
-0
develop/doc/searchindex.js
develop/doc/searchindex.js
+1
-1
develop/doc_cn/_sources/api/v2/config/layer.rst.txt
develop/doc_cn/_sources/api/v2/config/layer.rst.txt
+11
-0
develop/doc_cn/api/v2/config/layer.html
develop/doc_cn/api/v2/config/layer.html
+100
-0
develop/doc_cn/searchindex.js
develop/doc_cn/searchindex.js
+1
-1
未找到文件。
develop/doc/_sources/api/v2/config/layer.rst.txt
浏览文件 @
c99a8742
...
...
@@ -59,6 +59,11 @@ context_projection
.. autoclass:: paddle.v2.layer.context_projection
:noindex:
row_conv
--------
.. autoclass:: paddle.v2.layer.row_conv
:noindex:
Image Pooling Layer
===================
...
...
@@ -346,6 +351,12 @@ sampling_id
.. autoclass:: paddle.v2.layer.sampling_id
:noindex:
multiplex
---------
.. autoclass:: paddle.v2.layer.multiplex
:noindex:
Slicing and Joining Layers
==========================
...
...
develop/doc/api/v2/config/layer.html
浏览文件 @
c99a8742
...
...
@@ -558,6 +558,62 @@ parameter attribute is set by this parameter.</li>
</table>
</dd></dl>
</div>
<div
class=
"section"
id=
"row-conv"
>
<h3>
row_conv
<a
class=
"headerlink"
href=
"#row-conv"
title=
"Permalink to this headline"
>
¶
</a></h3>
<dl
class=
"class"
>
<dt>
<em
class=
"property"
>
class
</em><code
class=
"descclassname"
>
paddle.v2.layer.
</code><code
class=
"descname"
>
row_conv
</code></dt>
<dd><p>
The row convolution is called lookahead convolution. It is firstly
introduced in paper of
<a
class=
"reference external"
href=
"https://arxiv.org/pdf/1512.02595v1.pdf"
>
Deep Speech 2: End-toEnd Speech Recognition
in English and Mandarin
</a>
.
</p>
<p>
The bidirectional RNN that learns representation for a sequence by
performing a forward and a backward pass through the entire sequence.
However, unlike unidirectional RNNs, bidirectional RNNs are challenging
to deploy in an online and low-latency setting. The lookahead convolution
incorporates information from future subsequences in a computationally
efficient manner to improve unidirectional recurrent neural networks.
</p>
<p>
The connection of row convolution is different form the 1D sequence
convolution. Assumed that, the future context-length is k, that is to say,
it can get the output at timestep t by using the the input feature from t-th
timestep to (t+k+1)-th timestep. Assumed that the hidden dim of input
activations are d, the activations r_t for the new layer at time-step t are:
</p>
<div
class=
"math"
>
\[r_{t,r} = \sum_{j=1}^{k + 1} {w_{i,j}h_{t+j-1, i}}
\quad ext{for} \quad (1 \leq i \leq d)\]
</div>
<div
class=
"admonition note"
>
<p
class=
"first admonition-title"
>
Note
</p>
<p
class=
"last"
>
The
<cite>
context_len
</cite>
is
<cite>
k + 1
</cite>
. That is to say, the lookahead step
number plus one equals context_len.
</p>
</div>
<div
class=
"highlight-python"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
row_conv
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
row_conv
</span><span
class=
"p"
>
(
</span><span
class=
"nb"
>
input
</span><span
class=
"o"
>
=
</span><span
class=
"nb"
>
input
</span><span
class=
"p"
>
,
</span>
<span
class=
"n"
>
context_len
</span><span
class=
"o"
>
=
</span><span
class=
"mi"
>
3
</span><span
class=
"p"
>
)
</span>
</pre></div>
</div>
<table
class=
"docutils field-list"
frame=
"void"
rules=
"none"
>
<col
class=
"field-name"
/>
<col
class=
"field-body"
/>
<tbody
valign=
"top"
>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
Parameters:
</th><td
class=
"field-body"
><ul
class=
"first simple"
>
<li><strong>
input
</strong>
(
<em>
paddle.v2.config_base.Layer
</em>
)
–
The input layer.
</li>
<li><strong>
context_len
</strong>
(
<em>
int
</em>
)
–
The context length equals the lookahead step number
plus one.
</li>
<li><strong>
act
</strong>
(
<em>
paddle.v2.activation.Base
</em>
)
–
Activation Type. Default is linear activation.
</li>
<li><strong>
param_attr
</strong>
(
<em>
paddle.v2.attr.ParameterAttribute
</em>
)
–
The Parameter Attribute. If None, the parameter will be
initialized smartly. It
’
s better set it by yourself.
</li>
<li><strong>
layer_attr
</strong>
(
<em>
paddle.v2.attr.ExtraAttributeNone
</em>
)
–
Extra Layer config.
</li>
</ul>
</td>
</tr>
<tr
class=
"field-even field"
><th
class=
"field-name"
>
Returns:
</th><td
class=
"field-body"
><p
class=
"first"
>
paddle.v2.config_base.Layer object.
</p>
</td>
</tr>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
Return type:
</th><td
class=
"field-body"
><p
class=
"first last"
>
paddle.v2.config_base.Layer
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div
class=
"section"
id=
"image-pooling-layer"
>
...
...
@@ -2726,6 +2782,50 @@ Sampling one id for one sample.</p>
</table>
</dd></dl>
</div>
<div
class=
"section"
id=
"multiplex"
>
<h3>
multiplex
<a
class=
"headerlink"
href=
"#multiplex"
title=
"Permalink to this headline"
>
¶
</a></h3>
<dl
class=
"class"
>
<dt>
<em
class=
"property"
>
class
</em><code
class=
"descclassname"
>
paddle.v2.layer.
</code><code
class=
"descname"
>
multiplex
</code></dt>
<dd><p>
This layer multiplex multiple layers according to the index,
which is provided by the first input layer.
inputs[0]: the index of the layer to output of size batchSize.
inputs[1:N]; the candidate output data.
For each index i from 0 to batchSize -1, the output is the i-th row of the
(index[i] + 1)-th layer.
</p>
<p>
For each i-th row of output:
.. math:
</p>
<div
class=
"highlight-default"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
y
</span><span
class=
"p"
>
[
</span><span
class=
"n"
>
i
</span><span
class=
"p"
>
][
</span><span
class=
"n"
>
j
</span><span
class=
"p"
>
]
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
x_
</span><span
class=
"p"
>
{
</span><span
class=
"n"
>
x_
</span><span
class=
"p"
>
{
</span><span
class=
"mi"
>
0
</span><span
class=
"p"
>
}[
</span><span
class=
"n"
>
i
</span><span
class=
"p"
>
]
</span>
<span
class=
"o"
>
+
</span>
<span
class=
"mi"
>
1
</span><span
class=
"p"
>
}[
</span><span
class=
"n"
>
i
</span><span
class=
"p"
>
][
</span><span
class=
"n"
>
j
</span><span
class=
"p"
>
],
</span>
<span
class=
"n"
>
j
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"mi"
>
0
</span><span
class=
"p"
>
,
</span><span
class=
"mi"
>
1
</span><span
class=
"p"
>
,
</span>
<span
class=
"o"
>
...
</span>
<span
class=
"p"
>
,
</span>
<span
class=
"p"
>
(
</span><span
class=
"n"
>
x_
</span><span
class=
"p"
>
{
</span><span
class=
"mi"
>
1
</span><span
class=
"p"
>
}
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
width
</span>
<span
class=
"o"
>
-
</span>
<span
class=
"mi"
>
1
</span><span
class=
"p"
>
)
</span>
</pre></div>
</div>
<p>
where, y is output.
<span
class=
"math"
>
\(x_{k}\)
</span>
is the k-th input layer and
<span
class=
"math"
>
\(k = x_{0}[i] + 1\)
</span>
.
</p>
<p>
The example usage is:
</p>
<div
class=
"highlight-python"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
maxid
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
multiplex
</span><span
class=
"p"
>
(
</span><span
class=
"nb"
>
input
</span><span
class=
"o"
>
=
</span><span
class=
"n"
>
layers
</span><span
class=
"p"
>
)
</span>
</pre></div>
</div>
<table
class=
"docutils field-list"
frame=
"void"
rules=
"none"
>
<col
class=
"field-name"
/>
<col
class=
"field-body"
/>
<tbody
valign=
"top"
>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
Parameters:
</th><td
class=
"field-body"
><ul
class=
"first simple"
>
<li><strong>
input
</strong>
(
<em>
list of paddle.v2.config_base.Layer
</em>
)
–
Input layers.
</li>
<li><strong>
name
</strong>
(
<em>
basestring
</em>
)
–
Layer name.
</li>
<li><strong>
layer_attr
</strong>
(
<em>
paddle.v2.attr.ExtraAttribute
</em>
)
–
extra layer attributes.
</li>
</ul>
</td>
</tr>
<tr
class=
"field-even field"
><th
class=
"field-name"
>
Returns:
</th><td
class=
"field-body"
><p
class=
"first"
>
paddle.v2.config_base.Layer object.
</p>
</td>
</tr>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
Return type:
</th><td
class=
"field-body"
><p
class=
"first last"
>
paddle.v2.config_base.Layer
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div
class=
"section"
id=
"slicing-and-joining-layers"
>
...
...
develop/doc/searchindex.js
浏览文件 @
c99a8742
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
develop/doc_cn/_sources/api/v2/config/layer.rst.txt
浏览文件 @
c99a8742
...
...
@@ -59,6 +59,11 @@ context_projection
.. autoclass:: paddle.v2.layer.context_projection
:noindex:
row_conv
--------
.. autoclass:: paddle.v2.layer.row_conv
:noindex:
Image Pooling Layer
===================
...
...
@@ -346,6 +351,12 @@ sampling_id
.. autoclass:: paddle.v2.layer.sampling_id
:noindex:
multiplex
---------
.. autoclass:: paddle.v2.layer.multiplex
:noindex:
Slicing and Joining Layers
==========================
...
...
develop/doc_cn/api/v2/config/layer.html
浏览文件 @
c99a8742
...
...
@@ -565,6 +565,62 @@ parameter attribute is set by this parameter.</li>
</table>
</dd></dl>
</div>
<div
class=
"section"
id=
"row-conv"
>
<h3>
row_conv
<a
class=
"headerlink"
href=
"#row-conv"
title=
"永久链接至标题"
>
¶
</a></h3>
<dl
class=
"class"
>
<dt>
<em
class=
"property"
>
class
</em><code
class=
"descclassname"
>
paddle.v2.layer.
</code><code
class=
"descname"
>
row_conv
</code></dt>
<dd><p>
The row convolution is called lookahead convolution. It is firstly
introduced in paper of
<a
class=
"reference external"
href=
"https://arxiv.org/pdf/1512.02595v1.pdf"
>
Deep Speech 2: End-toEnd Speech Recognition
in English and Mandarin
</a>
.
</p>
<p>
The bidirectional RNN that learns representation for a sequence by
performing a forward and a backward pass through the entire sequence.
However, unlike unidirectional RNNs, bidirectional RNNs are challenging
to deploy in an online and low-latency setting. The lookahead convolution
incorporates information from future subsequences in a computationally
efficient manner to improve unidirectional recurrent neural networks.
</p>
<p>
The connection of row convolution is different form the 1D sequence
convolution. Assumed that, the future context-length is k, that is to say,
it can get the output at timestep t by using the the input feature from t-th
timestep to (t+k+1)-th timestep. Assumed that the hidden dim of input
activations are d, the activations r_t for the new layer at time-step t are:
</p>
<div
class=
"math"
>
\[r_{t,r} = \sum_{j=1}^{k + 1} {w_{i,j}h_{t+j-1, i}}
\quad ext{for} \quad (1 \leq i \leq d)\]
</div>
<div
class=
"admonition note"
>
<p
class=
"first admonition-title"
>
注解
</p>
<p
class=
"last"
>
The
<cite>
context_len
</cite>
is
<cite>
k + 1
</cite>
. That is to say, the lookahead step
number plus one equals context_len.
</p>
</div>
<div
class=
"highlight-python"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
row_conv
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
row_conv
</span><span
class=
"p"
>
(
</span><span
class=
"nb"
>
input
</span><span
class=
"o"
>
=
</span><span
class=
"nb"
>
input
</span><span
class=
"p"
>
,
</span>
<span
class=
"n"
>
context_len
</span><span
class=
"o"
>
=
</span><span
class=
"mi"
>
3
</span><span
class=
"p"
>
)
</span>
</pre></div>
</div>
<table
class=
"docutils field-list"
frame=
"void"
rules=
"none"
>
<col
class=
"field-name"
/>
<col
class=
"field-body"
/>
<tbody
valign=
"top"
>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
参数:
</th><td
class=
"field-body"
><ul
class=
"first simple"
>
<li><strong>
input
</strong>
(
<em>
paddle.v2.config_base.Layer
</em>
)
–
The input layer.
</li>
<li><strong>
context_len
</strong>
(
<em>
int
</em>
)
–
The context length equals the lookahead step number
plus one.
</li>
<li><strong>
act
</strong>
(
<em>
paddle.v2.activation.Base
</em>
)
–
Activation Type. Default is linear activation.
</li>
<li><strong>
param_attr
</strong>
(
<em>
paddle.v2.attr.ParameterAttribute
</em>
)
–
The Parameter Attribute. If None, the parameter will be
initialized smartly. It
’
s better set it by yourself.
</li>
<li><strong>
layer_attr
</strong>
(
<em>
paddle.v2.attr.ExtraAttributeNone
</em>
)
–
Extra Layer config.
</li>
</ul>
</td>
</tr>
<tr
class=
"field-even field"
><th
class=
"field-name"
>
返回:
</th><td
class=
"field-body"
><p
class=
"first"
>
paddle.v2.config_base.Layer object.
</p>
</td>
</tr>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
返回类型:
</th><td
class=
"field-body"
><p
class=
"first last"
>
paddle.v2.config_base.Layer
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div
class=
"section"
id=
"image-pooling-layer"
>
...
...
@@ -2733,6 +2789,50 @@ Sampling one id for one sample.</p>
</table>
</dd></dl>
</div>
<div
class=
"section"
id=
"multiplex"
>
<h3>
multiplex
<a
class=
"headerlink"
href=
"#multiplex"
title=
"永久链接至标题"
>
¶
</a></h3>
<dl
class=
"class"
>
<dt>
<em
class=
"property"
>
class
</em><code
class=
"descclassname"
>
paddle.v2.layer.
</code><code
class=
"descname"
>
multiplex
</code></dt>
<dd><p>
This layer multiplex multiple layers according to the index,
which is provided by the first input layer.
inputs[0]: the index of the layer to output of size batchSize.
inputs[1:N]; the candidate output data.
For each index i from 0 to batchSize -1, the output is the i-th row of the
(index[i] + 1)-th layer.
</p>
<p>
For each i-th row of output:
.. math:
</p>
<div
class=
"highlight-default"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
y
</span><span
class=
"p"
>
[
</span><span
class=
"n"
>
i
</span><span
class=
"p"
>
][
</span><span
class=
"n"
>
j
</span><span
class=
"p"
>
]
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
x_
</span><span
class=
"p"
>
{
</span><span
class=
"n"
>
x_
</span><span
class=
"p"
>
{
</span><span
class=
"mi"
>
0
</span><span
class=
"p"
>
}[
</span><span
class=
"n"
>
i
</span><span
class=
"p"
>
]
</span>
<span
class=
"o"
>
+
</span>
<span
class=
"mi"
>
1
</span><span
class=
"p"
>
}[
</span><span
class=
"n"
>
i
</span><span
class=
"p"
>
][
</span><span
class=
"n"
>
j
</span><span
class=
"p"
>
],
</span>
<span
class=
"n"
>
j
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"mi"
>
0
</span><span
class=
"p"
>
,
</span><span
class=
"mi"
>
1
</span><span
class=
"p"
>
,
</span>
<span
class=
"o"
>
...
</span>
<span
class=
"p"
>
,
</span>
<span
class=
"p"
>
(
</span><span
class=
"n"
>
x_
</span><span
class=
"p"
>
{
</span><span
class=
"mi"
>
1
</span><span
class=
"p"
>
}
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
width
</span>
<span
class=
"o"
>
-
</span>
<span
class=
"mi"
>
1
</span><span
class=
"p"
>
)
</span>
</pre></div>
</div>
<p>
where, y is output.
<span
class=
"math"
>
\(x_{k}\)
</span>
is the k-th input layer and
<span
class=
"math"
>
\(k = x_{0}[i] + 1\)
</span>
.
</p>
<p>
The example usage is:
</p>
<div
class=
"highlight-python"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
maxid
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
multiplex
</span><span
class=
"p"
>
(
</span><span
class=
"nb"
>
input
</span><span
class=
"o"
>
=
</span><span
class=
"n"
>
layers
</span><span
class=
"p"
>
)
</span>
</pre></div>
</div>
<table
class=
"docutils field-list"
frame=
"void"
rules=
"none"
>
<col
class=
"field-name"
/>
<col
class=
"field-body"
/>
<tbody
valign=
"top"
>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
参数:
</th><td
class=
"field-body"
><ul
class=
"first simple"
>
<li><strong>
input
</strong>
(
<em>
list of paddle.v2.config_base.Layer
</em>
)
–
Input layers.
</li>
<li><strong>
name
</strong>
(
<em>
basestring
</em>
)
–
Layer name.
</li>
<li><strong>
layer_attr
</strong>
(
<em>
paddle.v2.attr.ExtraAttribute
</em>
)
–
extra layer attributes.
</li>
</ul>
</td>
</tr>
<tr
class=
"field-even field"
><th
class=
"field-name"
>
返回:
</th><td
class=
"field-body"
><p
class=
"first"
>
paddle.v2.config_base.Layer object.
</p>
</td>
</tr>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
返回类型:
</th><td
class=
"field-body"
><p
class=
"first last"
>
paddle.v2.config_base.Layer
</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div
class=
"section"
id=
"slicing-and-joining-layers"
>
...
...
develop/doc_cn/searchindex.js
浏览文件 @
c99a8742
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录