Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
e2fd06c3
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
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,
size
=
l
.
config
.
size
)
@
layer_support
(
ERROR_CLIPPING
,
DROPOUT
)
@
wrap_name_default
()
@
layer_support
(
ERROR_CLIPPING
,
DROPOUT
)
@
wrap_act_default
(
act
=
LinearActivation
())
def
gated_unit_layer
(
input
,
size
,
act
=
None
,
name
=
None
,
gate_attr
=
None
,
gate_bias_attr
=
True
,
gate_param_attr
=
None
,
gate_bias_attr
=
True
,
inproj_attr
=
None
,
inproj_param_attr
=
None
,
inproj_bias_attr
=
True
,
inproj_layer_attr
=
None
,
layer_attr
=
None
):
"""
The gated unit layer implements a simple gating mechanism over the input.
...
...
@@ -5923,18 +5923,18 @@ def gated_unit_layer(input,
clipping threshold, dropout and so on. See ExtraLayerAttribute for
more details.
: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
parameter of the gate.
: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
the projection of input.
: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
projection of the input.
:type inproj_bias_attr: ParameterAttribute|None
...
...
@@ -5954,8 +5954,8 @@ def gated_unit_layer(input,
name
=
"%s_input_proj"
%
name
,
size
=
size
,
act
=
act
,
layer_attr
=
inproj_attr
,
param_attr
=
inproj_param_attr
,
layer_attr
=
inproj_layer_attr
,
bias_attr
=
inproj_bias_attr
)
gate
=
fc_layer
(
...
...
@@ -5963,8 +5963,8 @@ def gated_unit_layer(input,
name
=
"%s_gate"
%
name
,
act
=
SigmoidActivation
(),
input
=
input
,
param_attr
=
gate_param_attr
,
layer_attr
=
gate_attr
,
param_attr
=
gate_param_attr
,
bias_attr
=
gate_bias_attr
)
return
mixed_layer
(
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(
size
=
512
,
input
=
data
,
act
=
TanhActivation
(),
gate_param_attr
=
ParamAttr
(
initial_std
=
1e-4
),
gate_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
),
gate_param_attr
=
ParamAttr
(
initial_std
=
1e-4
),
gate_bias_attr
=
ParamAttr
(
initial_std
=
1
),
inproj_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
),
inproj_param_attr
=
ParamAttr
(
initial_std
=
1e-4
),
inproj_layer_attr
=
ExtraLayerAttribute
(
error_clipping_threshold
=
100.0
),
inproj_bias_attr
=
ParamAttr
(
initial_std
=
1
),
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录