@@ -681,8 +681,18 @@ def dynamic_gru(input,
681
681
The first part are weights of the update gate and reset gate with
682
682
shape :math:`(D \\ times 2D)`, and the second part are weights for
683
683
candidate hidden state with shape :math:`(D \\ times D)`.
684
- bias_attr(ParamAttr): The parameter attribute for learnable the
685
- hidden-hidden bias.
684
+
685
+ If it is set to None or one attribute of ParamAttr, dynamic_gru will
686
+ create ParamAttr as param_attr. If the Initializer of the param_attr
687
+ is not set, the parameter is initialized with Xavier. Default: None.
688
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias
689
+ of GRU. Note that the bias with :math:`(1 \\ times 3D)` concatenates
690
+ the bias in the update gate, reset gate and candidate calculations.
691
+ If it is set to False, no bias will be applied to the update gate,
692
+ reset gate and candidate calculations. If it is set to None or one
693
+ attribute of ParamAttr, dynamic_gru will create ParamAttr as
694
+ bias_attr. If the Initializer of the bias_attr is not set, the bias
695
+ is initialized zero. Default: None.
686
696
is_reverse(bool): Whether to compute reversed GRU, default
687
697
:attr:`False`.
688
698
gate_activation(str): The activation for update gate and reset gate.
@@ -781,10 +791,29 @@ def gru_unit(input,
781
791
782
792
Args:
783
793
input (Variable): The fc transformed input value of current step.
784
- hidden (Variable): The hidden value of lstm unit from previous step.
794
+ hidden (Variable): The hidden value of gru unit from previous step.
785
795
size (integer): The input dimension value.
786
- param_attr (ParamAttr): The weight parameters for gru unit. Default: None
787
- bias_attr (ParamAttr): The bias parameters for gru unit. Default: None
796
+ param_attr(ParamAttr|None): The parameter attribute for the learnable
797
+ hidden-hidden weight matrix. Note:
798
+
799
+ - The shape of the weight matrix is :math:`(T \\ times 3D)`, where
800
+ :math:`D` is the hidden size.
801
+ - All elements in the weight matrix can be divided into two parts.
802
+ The first part are weights of the update gate and reset gate with
803
+ shape :math:`(D \\ times 2D)`, and the second part are weights for
804
+ candidate hidden state with shape :math:`(D \\ times D)`.
805
+
806
+ If it is set to None or one attribute of ParamAttr, gru_unit will
807
+ create ParamAttr as param_attr. If the Initializer of the param_attr
808
+ is not set, the parameter is initialized with Xavier. Default: None.
809
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias
810
+ of GRU. Note that the bias with :math:`(1 \\ times 3D)` concatenates
811
+ the bias in the update gate, reset gate and candidate calculations.
812
+ If it is set to False, no bias will be applied to the update gate,
813
+ reset gate and candidate calculations. If it is set to None or one
814
+ attribute of ParamAttr, gru_unit will create ParamAttr as
815
+ bias_attr. If the Initializer of the bias_attr is not set, the bias
816
+ is initialized zero. Default: None.
788
817
activation (string): The activation type for cell (actNode).
789
818
Default: 'tanh'
790
819
gate_activation (string): The activation type for gates (actGate).
0 commit comments