<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – context projection parameter attribute.
<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute|None</em>) – padding parameter attribute of context projection layer.
None if user don’t care.</li>
If false, it means padding always be zero.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute|None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc bias parameter attribute. False if no bias,
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – fc bias parameter attribute. False if no bias,
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh.</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – pooling layer bias attr. False if no bias.
None if user don’t care.</li>
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – pooling layer bias attr. None if don’t care.
False if no bias.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – context projection parameter attribute.
<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute|None</em>) – padding parameter attribute of context projection layer.
None if user don’t care.</li>
If false, it means padding always be zero.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute|None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc bias parameter attribute. False if no bias,
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – fc bias parameter attribute. False if no bias,
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh.</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – pooling layer bias attr. False if no bias.
None if user don’t care.</li>
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – pooling layer bias attr. None if don’t care.
False if no bias.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<li><strong>return_seq</strong> (<em>bool</em>) – If set False, outputs of the last time step are
<li><strong>return_seq</strong> (<em>bool</em>) – If set False, the last time step of output are
concatenated and returned.
concatenated and returned.
If set True, the entire output sequences that are
If set True, the entire output sequences in forward
processed in forward and backward directions are
and backward directions are concatenated and returned.</li>
concatenated and returned.</li>
</ul>
</ul>
</td>
</td>
</tr>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">LayerOutput object accroding to the return_seq.</p>
<dd><p>Calculate and then return a context vector by attention machanism.
<dd><p>Calculate and return a context vector with attention mechanism.
Size of the context vector equals to size of the encoded_sequence.</p>
Size of the context vector equals to size of the encoded_sequence.</p>
<divclass="math">
<divclass="math">
\[ \begin{align}\begin{aligned}a(s_{i-1},h_{j}) & = v_{a}f(W_{a}s_{t-1} + U_{a}h_{j})\\e_{i,j} & = a(s_{i-1}, h_{j})\\a_{i,j} & = \frac{exp(e_{i,j})}{\sum_{k=1}^{T_x}{exp(e_{i,k})}}\\c_{i} & = \sum_{j=1}^{T_{x}}a_{i,j}h_{j}\end{aligned}\end{align} \]</div>
\[ \begin{align}\begin{aligned}a(s_{i-1},h_{j}) & = v_{a}f(W_{a}s_{t-1} + U_{a}h_{j})\\e_{i,j} & = a(s_{i-1}, h_{j})\\a_{i,j} & = \frac{exp(e_{i,j})}{\sum_{k=1}^{T_x}{exp(e_{i,k})}}\\c_{i} & = \sum_{j=1}^{T_{x}}a_{i,j}h_{j}\end{aligned}\end{align} \]</div>
...
@@ -917,8 +922,8 @@ Align and Translate</strong> for more details. The link is as follows:
...
@@ -917,8 +922,8 @@ Align and Translate</strong> for more details. The link is as follows:
<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – context projection parameter attribute.
<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute|None</em>) – padding parameter attribute of context projection layer.
None if user don’t care.</li>
If false, it means padding always be zero.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute|None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc bias parameter attribute. False if no bias,
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – fc bias parameter attribute. False if no bias,
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh.</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – pooling layer bias attr. False if no bias.
None if user don’t care.</li>
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – pooling layer bias attr. None if don’t care.
False if no bias.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – context projection parameter attribute.
<li><strong>context_proj_param_attr</strong> (<em>ParameterAttribute|None</em>) – padding parameter attribute of context projection layer.
None if user don’t care.</li>
If false, it means padding always be zero.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_layer_name</strong> (<em>basestring</em>) – fc layer name. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_param_attr</strong> (<em>ParameterAttribute|None</em>) – fc layer parameter attribute. None if user don’t care.</li>
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None</em>) – fc bias parameter attribute. False if no bias,
<li><strong>fc_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – fc bias parameter attribute. False if no bias,
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh.</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute|False|None</em>) – pooling layer bias attr. False if no bias.
None if user don’t care.</li>
None if user don’t care.</li>
<li><strong>fc_act</strong> (<em>BaseActivation</em>) – fc layer activation type. None means tanh</li>
<li><strong>pool_bias_attr</strong> (<em>ParameterAttribute</em><em> or </em><em>None.</em>) – pooling layer bias attr. None if don’t care.
False if no bias.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>fc_attr</strong> (<em>ExtraLayerAttribute</em>) – fc layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>context_attr</strong> (<em>ExtraLayerAttribute</em>) – context projection layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<li><strong>pool_attr</strong> (<em>ExtraLayerAttribute</em>) – pooling layer extra attribute.</li>
<dd><p>Calculate and then return a context vector by attention machanism.
<dd><p>Calculate and return a context vector with attention mechanism.
Size of the context vector equals to size of the encoded_sequence.</p>
Size of the context vector equals to size of the encoded_sequence.</p>
<divclass="math">
<divclass="math">
\[ \begin{align}\begin{aligned}a(s_{i-1},h_{j}) & = v_{a}f(W_{a}s_{t-1} + U_{a}h_{j})\\e_{i,j} & = a(s_{i-1}, h_{j})\\a_{i,j} & = \frac{exp(e_{i,j})}{\sum_{k=1}^{T_x}{exp(e_{i,k})}}\\c_{i} & = \sum_{j=1}^{T_{x}}a_{i,j}h_{j}\end{aligned}\end{align} \]</div>
\[ \begin{align}\begin{aligned}a(s_{i-1},h_{j}) & = v_{a}f(W_{a}s_{t-1} + U_{a}h_{j})\\e_{i,j} & = a(s_{i-1}, h_{j})\\a_{i,j} & = \frac{exp(e_{i,j})}{\sum_{k=1}^{T_x}{exp(e_{i,k})}}\\c_{i} & = \sum_{j=1}^{T_{x}}a_{i,j}h_{j}\end{aligned}\end{align} \]</div>
...
@@ -924,8 +929,8 @@ Align and Translate</strong> for more details. The link is as follows:
...
@@ -924,8 +929,8 @@ Align and Translate</strong> for more details. The link is as follows: