Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
迷途归一
Paddle
提交
b056a6bd
P
Paddle
项目概览
迷途归一
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b056a6bd
编写于
1月 23, 2018
作者:
T
Travis CI
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Deploy to GitHub Pages:
9536c4e3
上级
7b6b20c7
变更
6
展开全部
显示空白变更内容
内联
并排
Showing
6 changed file
with
220 addition
and
2 deletion
+220
-2
develop/doc/_sources/api/v2/fluid/layers.rst.txt
develop/doc/_sources/api/v2/fluid/layers.rst.txt
+5
-0
develop/doc/api/v2/fluid/layers.html
develop/doc/api/v2/fluid/layers.html
+104
-0
develop/doc/searchindex.js
develop/doc/searchindex.js
+1
-1
develop/doc_cn/_sources/api/v2/fluid/layers.rst.txt
develop/doc_cn/_sources/api/v2/fluid/layers.rst.txt
+5
-0
develop/doc_cn/api/v2/fluid/layers.html
develop/doc_cn/api/v2/fluid/layers.html
+104
-0
develop/doc_cn/searchindex.js
develop/doc_cn/searchindex.js
+1
-1
未找到文件。
develop/doc/_sources/api/v2/fluid/layers.rst.txt
浏览文件 @
b056a6bd
...
...
@@ -505,6 +505,11 @@ swish
.. autofunction:: paddle.v2.fluid.layers.swish
:noindex:
im2sequence
------
.. autofunction:: paddle.v2.fluid.layers.im2sequence
:noindex:
edit_distance
---------------
.. autofunction:: paddle.v2.fluid.layers.edit_distance_error
...
...
develop/doc/api/v2/fluid/layers.html
浏览文件 @
b056a6bd
...
...
@@ -3388,6 +3388,110 @@ Duplicable: False Optional: False</li>
</table>
</dd></dl>
</div>
<div
class=
"section"
id=
"im2sequence"
>
<h2>
im2sequence
<a
class=
"headerlink"
href=
"#im2sequence"
title=
"Permalink to this headline"
>
¶
</a></h2>
<dl
class=
"function"
>
<dt>
<code
class=
"descclassname"
>
paddle.v2.fluid.layers.
</code><code
class=
"descname"
>
im2sequence
</code><span
class=
"sig-paren"
>
(
</span><em>
input
</em>
,
<em>
filter_size=1
</em>
,
<em>
stride=1
</em>
,
<em>
padding=0
</em>
,
<em>
name=None
</em><span
class=
"sig-paren"
>
)
</span></dt>
<dd><p>
Extracts image patches from the input tensor to form a tensor of shape
{input.batch_size * output_height * output_width, filter_size_H *
filter_size_W * input.channels} which is similar with im2col.
This op use filter / kernel to scan images and convert these images to
sequences. After expanding, the number of time step are
output_height * output_width for an image, in which output_height and
output_width are calculated by below equation:
</p>
<div
class=
"math"
>
\[output\_size = 1 + (2 * padding + img\_size - block\_size + stride - 1) / stride\]
</div>
<p>
And the dimension of each time step is block_y * block_x * input.channels.
</p>
<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>
Variable
</em>
)
–
The input should be a tensor in NCHW format.
</li>
<li><strong>
filter_size
</strong>
(
<em>
int|tuple|None
</em>
)
–
The filter size. If filter_size is a tuple,
it must contain two integers, (filter_size_H, filter_size_W).
Otherwise, the filter will be a square.
</li>
<li><strong>
stride
</strong>
(
<em>
int|tuple
</em>
)
–
The stride size. If stride is a tuple, it must
contain two integers, (stride_H, stride_W). Otherwise, the
stride_H = stride_W = stride. Default: stride = 1.
</li>
<li><strong>
padding
</strong>
(
<em>
int|tuple
</em>
)
–
The padding size. If padding is a tuple, it can
contain two integers like (padding_H, padding_W) which means
padding_up = padding_down = padding_H and
padding_left = padding_right = padding_W. Or it can use
(padding_up, padding_left, padding_down, padding_right) to indicate
paddings of four direction. Otherwise, a scalar padding means
padding_up = padding_down = padding_left = padding_right = padding
Default: padding = 0.
</li>
<li><strong>
name
</strong>
(
<em>
int
</em>
)
–
The name of this layer. It is optional.
</li>
</ul>
</td>
</tr>
<tr
class=
"field-even field"
><th
class=
"field-name"
>
Returns:
</th><td
class=
"field-body"
><p
class=
"first"
>
The output is a LoDTensor with shape
{input.batch_size * output_height * output_width,
filter_size_H * filter_size_W * input.channels}.
If we regard output as a matrix, each row of this matrix is
a step of a sequence.
</p>
</td>
</tr>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
Return type:
</th><td
class=
"field-body"
><p
class=
"first last"
>
output
</p>
</td>
</tr>
</tbody>
</table>
<p>
Examples:
</p>
<p>
As an example:
</p>
<blockquote>
<div><div
class=
"highlight-text"
><div
class=
"highlight"
><pre><span></span>
Given:
x = [[[[ 6. 2. 1.]
[ 8. 3. 5.]
[ 0. 2. 6.]]
[[ 2. 4. 4.]
[ 6. 3. 0.]
[ 6. 4. 7.]]]
[[[ 6. 7. 1.]
[ 5. 7. 9.]
[ 2. 4. 8.]]
[[ 1. 2. 1.]
[ 1. 3. 5.]
[ 9. 0. 8.]]]]
x.dims = {2, 2, 3, 3}
And:
filter = [2, 2]
stride = [1, 1]
padding = [0, 0]
Then:
output.data = [[ 6. 2. 8. 3. 2. 4. 6. 3.]
[ 2. 1. 3. 5. 4. 4. 3. 0.]
[ 8. 3. 0. 2. 6. 3. 6. 4.]
[ 3. 5. 2. 6. 3. 0. 4. 7.]
[ 6. 7. 5. 7. 1. 2. 1. 3.]
[ 7. 1. 7. 9. 2. 1. 3. 5.]
[ 5. 7. 2. 4. 1. 3. 9. 0.]
[ 7. 9. 4. 8. 3. 5. 0. 8.]]
output.dims = {8, 9}
output.lod = [[0, 4, 8]]
</pre></div>
</div>
<p>
The simple usage is:
</p>
<div
class=
"highlight-python"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
output
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
fluid
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
layers
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
im2sequence
</span><span
class=
"p"
>
(
</span><span
class=
"nb"
>
input
</span><span
class=
"o"
>
=
</span><span
class=
"n"
>
layer
</span><span
class=
"p"
>
,
</span>
<span
class=
"n"
>
stride
</span><span
class=
"o"
>
=
</span><span
class=
"p"
>
[
</span><span
class=
"mi"
>
1
</span><span
class=
"p"
>
,
</span>
<span
class=
"mi"
>
1
</span><span
class=
"p"
>
],
</span>
<span
class=
"n"
>
filter_size
</span><span
class=
"o"
>
=
</span><span
class=
"p"
>
[
</span><span
class=
"mi"
>
2
</span><span
class=
"p"
>
,
</span>
<span
class=
"mi"
>
2
</span><span
class=
"p"
>
])
</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
</div>
<div
class=
"section"
id=
"edit-distance"
>
<h2>
edit_distance
<a
class=
"headerlink"
href=
"#edit-distance"
title=
"Permalink to this headline"
>
¶
</a></h2>
...
...
develop/doc/searchindex.js
浏览文件 @
b056a6bd
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
develop/doc_cn/_sources/api/v2/fluid/layers.rst.txt
浏览文件 @
b056a6bd
...
...
@@ -505,6 +505,11 @@ swish
.. autofunction:: paddle.v2.fluid.layers.swish
:noindex:
im2sequence
------
.. autofunction:: paddle.v2.fluid.layers.im2sequence
:noindex:
edit_distance
---------------
.. autofunction:: paddle.v2.fluid.layers.edit_distance_error
...
...
develop/doc_cn/api/v2/fluid/layers.html
浏览文件 @
b056a6bd
...
...
@@ -3407,6 +3407,110 @@ Duplicable: False Optional: False</li>
</table>
</dd></dl>
</div>
<div
class=
"section"
id=
"im2sequence"
>
<h2>
im2sequence
<a
class=
"headerlink"
href=
"#im2sequence"
title=
"永久链接至标题"
>
¶
</a></h2>
<dl
class=
"function"
>
<dt>
<code
class=
"descclassname"
>
paddle.v2.fluid.layers.
</code><code
class=
"descname"
>
im2sequence
</code><span
class=
"sig-paren"
>
(
</span><em>
input
</em>
,
<em>
filter_size=1
</em>
,
<em>
stride=1
</em>
,
<em>
padding=0
</em>
,
<em>
name=None
</em><span
class=
"sig-paren"
>
)
</span></dt>
<dd><p>
Extracts image patches from the input tensor to form a tensor of shape
{input.batch_size * output_height * output_width, filter_size_H *
filter_size_W * input.channels} which is similar with im2col.
This op use filter / kernel to scan images and convert these images to
sequences. After expanding, the number of time step are
output_height * output_width for an image, in which output_height and
output_width are calculated by below equation:
</p>
<div
class=
"math"
>
\[output\_size = 1 + (2 * padding + img\_size - block\_size + stride - 1) / stride\]
</div>
<p>
And the dimension of each time step is block_y * block_x * input.channels.
</p>
<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>
Variable
</em>
)
–
The input should be a tensor in NCHW format.
</li>
<li><strong>
filter_size
</strong>
(
<em>
int|tuple|None
</em>
)
–
The filter size. If filter_size is a tuple,
it must contain two integers, (filter_size_H, filter_size_W).
Otherwise, the filter will be a square.
</li>
<li><strong>
stride
</strong>
(
<em>
int|tuple
</em>
)
–
The stride size. If stride is a tuple, it must
contain two integers, (stride_H, stride_W). Otherwise, the
stride_H = stride_W = stride. Default: stride = 1.
</li>
<li><strong>
padding
</strong>
(
<em>
int|tuple
</em>
)
–
The padding size. If padding is a tuple, it can
contain two integers like (padding_H, padding_W) which means
padding_up = padding_down = padding_H and
padding_left = padding_right = padding_W. Or it can use
(padding_up, padding_left, padding_down, padding_right) to indicate
paddings of four direction. Otherwise, a scalar padding means
padding_up = padding_down = padding_left = padding_right = padding
Default: padding = 0.
</li>
<li><strong>
name
</strong>
(
<em>
int
</em>
)
–
The name of this layer. It is optional.
</li>
</ul>
</td>
</tr>
<tr
class=
"field-even field"
><th
class=
"field-name"
>
返回:
</th><td
class=
"field-body"
><p
class=
"first"
>
The output is a LoDTensor with shape
{input.batch_size * output_height * output_width,
filter_size_H * filter_size_W * input.channels}.
If we regard output as a matrix, each row of this matrix is
a step of a sequence.
</p>
</td>
</tr>
<tr
class=
"field-odd field"
><th
class=
"field-name"
>
返回类型:
</th><td
class=
"field-body"
><p
class=
"first last"
>
output
</p>
</td>
</tr>
</tbody>
</table>
<p>
Examples:
</p>
<p>
As an example:
</p>
<blockquote>
<div><div
class=
"highlight-text"
><div
class=
"highlight"
><pre><span></span>
Given:
x = [[[[ 6. 2. 1.]
[ 8. 3. 5.]
[ 0. 2. 6.]]
[[ 2. 4. 4.]
[ 6. 3. 0.]
[ 6. 4. 7.]]]
[[[ 6. 7. 1.]
[ 5. 7. 9.]
[ 2. 4. 8.]]
[[ 1. 2. 1.]
[ 1. 3. 5.]
[ 9. 0. 8.]]]]
x.dims = {2, 2, 3, 3}
And:
filter = [2, 2]
stride = [1, 1]
padding = [0, 0]
Then:
output.data = [[ 6. 2. 8. 3. 2. 4. 6. 3.]
[ 2. 1. 3. 5. 4. 4. 3. 0.]
[ 8. 3. 0. 2. 6. 3. 6. 4.]
[ 3. 5. 2. 6. 3. 0. 4. 7.]
[ 6. 7. 5. 7. 1. 2. 1. 3.]
[ 7. 1. 7. 9. 2. 1. 3. 5.]
[ 5. 7. 2. 4. 1. 3. 9. 0.]
[ 7. 9. 4. 8. 3. 5. 0. 8.]]
output.dims = {8, 9}
output.lod = [[0, 4, 8]]
</pre></div>
</div>
<p>
The simple usage is:
</p>
<div
class=
"highlight-python"
><div
class=
"highlight"
><pre><span></span><span
class=
"n"
>
output
</span>
<span
class=
"o"
>
=
</span>
<span
class=
"n"
>
fluid
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
layers
</span><span
class=
"o"
>
.
</span><span
class=
"n"
>
im2sequence
</span><span
class=
"p"
>
(
</span><span
class=
"nb"
>
input
</span><span
class=
"o"
>
=
</span><span
class=
"n"
>
layer
</span><span
class=
"p"
>
,
</span>
<span
class=
"n"
>
stride
</span><span
class=
"o"
>
=
</span><span
class=
"p"
>
[
</span><span
class=
"mi"
>
1
</span><span
class=
"p"
>
,
</span>
<span
class=
"mi"
>
1
</span><span
class=
"p"
>
],
</span>
<span
class=
"n"
>
filter_size
</span><span
class=
"o"
>
=
</span><span
class=
"p"
>
[
</span><span
class=
"mi"
>
2
</span><span
class=
"p"
>
,
</span>
<span
class=
"mi"
>
2
</span><span
class=
"p"
>
])
</span>
</pre></div>
</div>
</div></blockquote>
</dd></dl>
</div>
<div
class=
"section"
id=
"edit-distance"
>
<h2>
edit_distance
<a
class=
"headerlink"
href=
"#edit-distance"
title=
"永久链接至标题"
>
¶
</a></h2>
...
...
develop/doc_cn/searchindex.js
浏览文件 @
b056a6bd
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录