Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
b4c1d175
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b4c1d175
编写于
1月 26, 2017
作者:
H
Haonan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove flip_layer
上级
55eb2fcf
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
43 deletion
+1
-43
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+0
-41
python/paddle/trainer_config_helpers/tests/layers_test_config.py
...paddle/trainer_config_helpers/tests/layers_test_config.py
+1
-2
未找到文件。
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
b4c1d175
...
...
@@ -71,7 +71,6 @@ __all__ = [
'bilinear_interp_layer'
,
'trans_layer'
,
'rotate_layer'
,
'flip_layer'
,
'sum_to_one_norm_layer'
,
'get_output_layer'
,
'LayerType'
,
...
...
@@ -1720,46 +1719,6 @@ def rotate_layer(input, height, name=None, layer_attr=None):
size
=
l
.
config
.
size
)
@
wrap_name_default
()
@
layer_support
()
def
flip_layer
(
input
,
height
,
name
=
None
,
layer_attr
=
None
):
"""
A layer for flipping the matrix w.r.t the matrix center.
It's essentially rotating the matrix twice.
Used for input as image or map.
.. math::
y(i,j) = x(M-i-1, N-j-1)
where :math:`x` is (M x N) input, and :math:`y` is (M x N) output.
The example usage is:
.. code-block:: python
flip = flip_layer(input=layer,
height=100)
:param input: Input layer.
:type input: LayerOutput
:param height: The height of the sample matrix
:type height: int
:param name: Layer name.
:type name: basestring
:param layer_attr: extra layer attributes.
:type layer_attr: ExtraLayerAttribute.
:return: LayerOutput object.
:rtype: LayerOutput
"""
assert
isinstance
(
input
,
LayerOutput
)
return
rotate_layer
(
input
=
rotate_layer
(
input
=
input
,
height
=
height
),
height
=
height
,
name
=
name
,
layer_attr
=
layer_attr
)
@
wrap_name_default
()
@
layer_support
()
def
cos_sim
(
a
,
b
,
scale
=
1
,
size
=
1
,
name
=
None
,
layer_attr
=
None
):
...
...
python/paddle/trainer_config_helpers/tests/layers_test_config.py
浏览文件 @
b4c1d175
...
...
@@ -40,7 +40,6 @@ assert z1.size > 0
y2
=
fc_layer
(
input
=
y
,
size
=
15
)
z2
=
rotate_layer
(
input
=
y2
,
height
=
5
)
z3
=
flip_layer
(
input
=
y2
,
height
=
3
)
cos1
=
cos_sim
(
a
=
x1
,
b
=
y1
)
cos3
=
cos_sim
(
a
=
x1
,
b
=
y2
,
size
=
3
)
...
...
@@ -48,7 +47,7 @@ cos3 = cos_sim(a=x1, b=y2, size=3)
linear_comb
=
linear_comb_layer
(
weights
=
x1
,
vectors
=
y2
,
size
=
3
)
out
=
fc_layer
(
input
=
[
cos1
,
cos3
,
linear_comb
,
z
,
z1
,
z2
,
z3
],
input
=
[
cos1
,
cos3
,
linear_comb
,
z
,
z1
,
z2
],
size
=
num_classes
,
act
=
SoftmaxActivation
())
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录