Skip to content

Commit e2fd06c

Browse files
committed
refine name of the input parameter.
1 parent ac69f77 commit e2fd06c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

python/paddle/trainer_config_helpers/layers.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5879,19 +5879,19 @@ def prelu_layer(input,
58795879
size=l.config.size)
58805880

58815881

5882-
@layer_support(ERROR_CLIPPING, DROPOUT)
58835882
@wrap_name_default()
5883+
@layer_support(ERROR_CLIPPING, DROPOUT)
58845884
@wrap_act_default(act=LinearActivation())
58855885
def gated_unit_layer(input,
58865886
size,
58875887
act=None,
58885888
name=None,
58895889
gate_attr=None,
5890-
gate_bias_attr=True,
58915890
gate_param_attr=None,
5891+
gate_bias_attr=True,
5892+
inproj_attr=None,
58925893
inproj_param_attr=None,
58935894
inproj_bias_attr=True,
5894-
inproj_layer_attr=None,
58955895
layer_attr=None):
58965896
"""
58975897
The gated unit layer implements a simple gating mechanism over the input.
@@ -5923,18 +5923,18 @@ def gated_unit_layer(input,
59235923
clipping threshold, dropout and so on. See ExtraLayerAttribute for
59245924
more details.
59255925
:type gate_attr: ExtraLayerAttribute|None
5926-
:param gate_bias_attr: Attributes to tune the learnable bias of the gate.
5927-
:type gate_bias_attr: ParameterAttribute|None
59285926
:param gate_param_attr: Attributes to tune the learnable projected matrix
59295927
parameter of the gate.
59305928
:type gate_param_attr: ParameterAttribute|None
5929+
:param gate_bias_attr: Attributes to tune the learnable bias of the gate.
5930+
:type gate_bias_attr: ParameterAttribute|None
5931+
:param inproj_attr: Attributes to the tune the projected input, for
5932+
example, error clipping threshold, dropout and so on. See
5933+
ExtraLayerAttribute for more details.
5934+
:type inproj_attr: ExtraLayerAttribute|None
59315935
:param inproj_param_attr: Attributes to tune the learnable parameter of
59325936
the projection of input.
59335937
:type inproj_param_attr: ParameterAttribute|None
5934-
:param inproj_layer_attr: Attributes to the tune the projected input, for
5935-
example, error clipping threshold, dropout and so on. See
5936-
ExtraLayerAttribute for more details.
5937-
:type inproj_layer_attr: ExtraLayerAttribute|None
59385938
:param inproj_bias_attr: Attributes to tune the learnable bias of
59395939
projection of the input.
59405940
:type inproj_bias_attr: ParameterAttribute|None
@@ -5954,17 +5954,17 @@ def gated_unit_layer(input,
59545954
name="%s_input_proj" % name,
59555955
size=size,
59565956
act=act,
5957+
layer_attr=inproj_attr,
59575958
param_attr=inproj_param_attr,
5958-
layer_attr=inproj_layer_attr,
59595959
bias_attr=inproj_bias_attr)
59605960

59615961
gate = fc_layer(
59625962
size=size,
59635963
name="%s_gate" % name,
59645964
act=SigmoidActivation(),
59655965
input=input,
5966-
param_attr=gate_param_attr,
59675966
layer_attr=gate_attr,
5967+
param_attr=gate_param_attr,
59685968
bias_attr=gate_bias_attr)
59695969
return mixed_layer(
59705970
name="%s_gated_act" % name,

python/paddle/trainer_config_helpers/tests/configs/test_gated_unit_layer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
size=512,
66
input=data,
77
act=TanhActivation(),
8-
gate_param_attr=ParamAttr(initial_std=1e-4),
98
gate_attr=ExtraLayerAttribute(error_clipping_threshold=100.0),
9+
gate_param_attr=ParamAttr(initial_std=1e-4),
1010
gate_bias_attr=ParamAttr(initial_std=1),
11+
inproj_attr=ExtraLayerAttribute(error_clipping_threshold=100.0),
1112
inproj_param_attr=ParamAttr(initial_std=1e-4),
12-
inproj_layer_attr=ExtraLayerAttribute(error_clipping_threshold=100.0),
1313
inproj_bias_attr=ParamAttr(initial_std=1),
1414
layer_attr=ExtraLayerAttribute(error_clipping_threshold=100.0))
1515

0 commit comments

Comments
 (0)