Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
e2fd06c3
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e2fd06c3
编写于
7月 14, 2017
作者:
C
caoying03
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine name of the input parameter.
上级
ac69f773
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
13 addition
and
13 deletion
+13
-13
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+11
-11
python/paddle/trainer_config_helpers/tests/configs/test_gated_unit_layer.py
...ner_config_helpers/tests/configs/test_gated_unit_layer.py
+2
-2
未找到文件。
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
e2fd06c3
...
@@ -5879,19 +5879,19 @@ def prelu_layer(input,
...
@@ -5879,19 +5879,19 @@ def prelu_layer(input,
size
=
l
.
config
.
size
)
size
=
l
.
config
.
size
)
@
layer_support
(
ERROR_CLIPPING
,
DROPOUT
)
@
wrap_name_default
()
@
wrap_name_default
()
@
layer_support
(
ERROR_CLIPPING
,
DROPOUT
)
@
wrap_act_default
(
act
=
LinearActivation
())
@
wrap_act_default
(
act
=
LinearActivation
())
def
gated_unit_layer
(
input
,
def
gated_unit_layer
(
input
,
size
,
size
,
act
=
None
,
act
=
None
,
name
=
None
,
name
=
None
,
gate_attr
=
None
,
gate_attr
=
None
,
gate_bias_attr
=
True
,
gate_param_attr
=
None
,
gate_param_attr
=
None
,
gate_bias_attr
=
True
,
inproj_attr
=
None
,
inproj_param_attr
=
None
,
inproj_param_attr
=
None
,
inproj_bias_attr
=
True
,
inproj_bias_attr
=
True
,
inproj_layer_attr
=
None
,
layer_attr
=
None
):
layer_attr
=
None
):
"""
"""
The gated unit layer implements a simple gating mechanism over the input.
The gated unit layer implements a simple gating mechanism over the input.
...
@@ -5923,18 +5923,18 @@ def gated_unit_layer(input,
...
@@ -5923,18 +5923,18 @@ def gated_unit_layer(input,
clipping threshold, dropout and so on. See ExtraLayerAttribute for
clipping threshold, dropout and so on. See ExtraLayerAttribute for
more details.
more details.
:type gate_attr: ExtraLayerAttribute|None
:type gate_attr: ExtraLayerAttribute|None
:param gate_bias_attr: Attributes to tune the learnable bias of the gate.
:type gate_bias_attr: ParameterAttribute|None
:param gate_param_attr: Attributes to tune the learnable projected matrix
:param gate_param_attr: Attributes to tune the learnable projected matrix
parameter of the gate.
parameter of the gate.
:type gate_param_attr: ParameterAttribute|None
:type gate_param_attr: ParameterAttribute|None
:param gate_bias_attr: Attributes to tune the learnable bias of the gate.
:type gate_bias_attr: ParameterAttribute|None
:param inproj_attr: Attributes to the tune the projected input, for
example, error clipping threshold, dropout and so on. See
ExtraLayerAttribute for more details.
:type inproj_attr: ExtraLayerAttribute|None
:param inproj_param_attr: Attributes to tune the learnable parameter of
:param inproj_param_attr: Attributes to tune the learnable parameter of
the projection of input.
the projection of input.
:type inproj_param_attr: ParameterAttribute|None
:type inproj_param_attr: ParameterAttribute|None
:param inproj_layer_attr: Attributes to the tune the projected input, for
example, error clipping threshold, dropout and so on. See
ExtraLayerAttribute for more details.
:type inproj_layer_attr: ExtraLayerAttribute|None
:param inproj_bias_attr: Attributes to tune the learnable bias of
:param inproj_bias_attr: Attributes to tune the learnable bias of
projection of the input.
projection of the input.
:type inproj_bias_attr: ParameterAttribute|None
:type inproj_bias_attr: ParameterAttribute|None
...
@@ -5954,8 +5954,8 @@ def gated_unit_layer(input,
...
@@ -5954,8 +5954,8 @@ def gated_unit_layer(input,
name
=
"%s_input_proj"
%
name
,
name
=
"%s_input_proj"
%
name
,
size
=
size
,
size
=
size
,
act
=
act
,
act
=
act
,
layer_attr
=
inproj_attr
,
param_attr
=
inproj_param_attr
,
param_attr
=
inproj_param_attr
,
layer_attr
=
inproj_layer_attr
,
bias_attr
=
inproj_bias_attr
)
bias_attr
=
inproj_bias_attr
)
gate
=
fc_layer
(
gate
=
fc_layer
(
...
@@ -5963,8 +5963,8 @@ def gated_unit_layer(input,
...
@@ -5963,8 +5963,8 @@ def gated_unit_layer(input,
name
=
"%s_gate"
%
name
,
name
=
"%s_gate"
%
name
,
act
=
SigmoidActivation
(),
act
=
SigmoidActivation
(),
input
=
input
,
input
=
input
,
param_attr
=
gate_param_attr
,
layer_attr
=
gate_attr
,
layer_attr
=
gate_attr
,
param_attr
=
gate_param_attr
,
bias_attr
=
gate_bias_attr
)
bias_attr
=
gate_bias_attr
)
return
mixed_layer
(
return
mixed_layer
(
name
=
"%s_gated_act"
%
name
,
name
=
"%s_gated_act"
%
name
,
...
...
python/paddle/trainer_config_helpers/tests/configs/test_gated_unit_layer.py
浏览文件 @
e2fd06c3
...
@@ -5,11 +5,11 @@ glu = gated_unit_layer(
...
@@ -5,11 +5,11 @@ glu = gated_unit_layer(
size
=
512
,
size
=
512
,
input
=
data
,
input
=
data
,
act
=
TanhActivation
(),
act
=
TanhActivation
(),
gate_param_attr
=
ParamAttr
(
initial_std
=
1e-4
),
gate_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
),
gate_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
),
gate_param_attr
=
ParamAttr
(
initial_std
=
1e-4
),
gate_bias_attr
=
ParamAttr
(
initial_std
=
1
),
gate_bias_attr
=
ParamAttr
(
initial_std
=
1
),
inproj_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
),
inproj_param_attr
=
ParamAttr
(
initial_std
=
1e-4
),
inproj_param_attr
=
ParamAttr
(
initial_std
=
1e-4
),
inproj_layer_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
),
inproj_bias_attr
=
ParamAttr
(
initial_std
=
1
),
inproj_bias_attr
=
ParamAttr
(
initial_std
=
1
),
layer_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
))
layer_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录