@@ -701,8 +701,18 @@ def dynamic_gru(input,
701
701
The first part are weights of the update gate and reset gate with
702
702
shape :math:`(D \\ times 2D)`, and the second part are weights for
703
703
candidate hidden state with shape :math:`(D \\ times D)`.
704
- bias_attr(ParamAttr): The parameter attribute for learnable the
705
- hidden-hidden bias.
704
+
705
+ If it is set to None or one attribute of ParamAttr, dynamic_gru will
706
+ create ParamAttr as param_attr. If the Initializer of the param_attr
707
+ is not set, the parameter is initialized with Xavier. Default: None.
708
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias
709
+ of GRU. Note that the bias with :math:`(1 \\ times 3D)` concatenates
710
+ the bias in the update gate, reset gate and candidate calculations.
711
+ If it is set to False, no bias will be applied to the update gate,
712
+ reset gate and candidate calculations. If it is set to None or one
713
+ attribute of ParamAttr, dynamic_gru will create ParamAttr as
714
+ bias_attr. If the Initializer of the bias_attr is not set, the bias
715
+ is initialized zero. Default: None.
706
716
is_reverse(bool): Whether to compute reversed GRU, default
707
717
:attr:`False`.
708
718
gate_activation(str): The activation for update gate and reset gate.
@@ -801,10 +811,29 @@ def gru_unit(input,
801
811
802
812
Args:
803
813
input (Variable): The fc transformed input value of current step.
804
- hidden (Variable): The hidden value of lstm unit from previous step.
814
+ hidden (Variable): The hidden value of gru unit from previous step.
805
815
size (integer): The input dimension value.
806
- param_attr (ParamAttr): The weight parameters for gru unit. Default: None
807
- bias_attr (ParamAttr): The bias parameters for gru unit. Default: None
816
+ param_attr(ParamAttr|None): The parameter attribute for the learnable
817
+ hidden-hidden weight matrix. Note:
818
+
819
+ - The shape of the weight matrix is :math:`(T \\ times 3D)`, where
820
+ :math:`D` is the hidden size.
821
+ - All elements in the weight matrix can be divided into two parts.
822
+ The first part are weights of the update gate and reset gate with
823
+ shape :math:`(D \\ times 2D)`, and the second part are weights for
824
+ candidate hidden state with shape :math:`(D \\ times D)`.
825
+
826
+ If it is set to None or one attribute of ParamAttr, gru_unit will
827
+ create ParamAttr as param_attr. If the Initializer of the param_attr
828
+ is not set, the parameter is initialized with Xavier. Default: None.
829
+ bias_attr (ParamAttr|bool|None): The parameter attribute for the bias
830
+ of GRU. Note that the bias with :math:`(1 \\ times 3D)` concatenates
831
+ the bias in the update gate, reset gate and candidate calculations.
832
+ If it is set to False, no bias will be applied to the update gate,
833
+ reset gate and candidate calculations. If it is set to None or one
834
+ attribute of ParamAttr, gru_unit will create ParamAttr as
835
+ bias_attr. If the Initializer of the bias_attr is not set, the bias
836
+ is initialized zero. Default: None.
808
837
activation (string): The activation type for cell (actNode).
809
838
Default: 'tanh'
810
839
gate_activation (string): The activation type for gates (actGate).
0 commit comments