@@ -1007,7 +1007,7 @@ the given labels as soft labels, default <cite>False</cite>.</li>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first">A 2-D tensor with shape [N x 1], the cross entropy loss.</p>
</td>
</tr>
<trclass="field-odd field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><cite>ValueError</cite>– 1) the 1st dimension of <cite>input</cite> and <cite>label</cite> are not equal; 2) when <cite>soft_label == True</cite>, and the 2nd dimension of <cite>input</cite> and <cite>label</cite> are not equal; 3) when <cite>soft_label == False</cite>, and the 2nd dimension of <cite>label</cite> is not 1.</p>
<trclass="field-odd field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><cite>ValueError</cite>– 1) the 1st dimension of <cite>input</cite> and <cite>label</cite> are not equal; 2) when <cite>soft_label == True</cite>, and the 2nd dimension of <cite>input</cite> and <cite>label</cite> are not equal; 3) when <cite>soft_label == False</cite>, and the 2nd dimension of <cite>label</cite> is not 1.</p>
</td>
</tr>
</tbody>
...
...
@@ -2020,16 +2020,17 @@ explain how sequence_expand works:</p>
<dd><p>Lstm unit layer. The equation of a lstm step is:</p>
<blockquote>
<div><divclass="math">
\[ \begin{align}\begin{aligned}i_t & = \sigma(W_{x_i}x_{t} + W_{h_i}h_{t-1} + W_{c_i}c_{t-1} + b_i)\\f_t & = \sigma(W_{x_f}x_{t} + W_{h_f}h_{t-1} + W_{c_f}c_{t-1} + b_f)\\c_t & = f_tc_{t-1} + i_t tanh (W_{x_c}x_t+W_{h_c}h_{t-1} + b_c)\\o_t & = \sigma(W_{x_o}x_{t} + W_{h_o}h_{t-1} + W_{c_o}c_t + b_o)\\h_t & = o_t tanh(c_t)\end{aligned}\end{align} \]</div>
\[ \begin{align}\begin{aligned}i_t & = \sigma(W_{x_i}x_{t} + W_{h_i}h_{t-1} + b_i)\\f_t & = \sigma(W_{x_f}x_{t} + W_{h_f}h_{t-1} + b_f)\\c_t & = f_tc_{t-1} + i_t tanh (W_{x_c}x_t + W_{h_c}h_{t-1} + b_c)\\o_t & = \sigma(W_{x_o}x_{t} + W_{h_o}h_{t-1} + b_o)\\h_t & = o_t tanh(c_t)\end{aligned}\end{align} \]</div>
</div></blockquote>
<p>The inputs of lstm unit includes <spanclass="math">\(x_t\)</span>, <spanclass="math">\(h_{t-1}\)</span> and
<spanclass="math">\(c_{t-1}\)</span>. The implementation separates the linear transformation
and non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an
example. The linear transformation is applied by calling a <cite>fc</cite> layer and
the equation is:</p>
<p>The inputs of lstm unit include <spanclass="math">\(x_t\)</span>, <spanclass="math">\(h_{t-1}\)</span> and
<spanclass="math">\(c_{t-1}\)</span>. The 2nd dimensions of <spanclass="math">\(h_{t-1}\)</span> and <spanclass="math">\(c_{t-1}\)</span>
should be same. The implementation separates the linear transformation and
non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an example.
The linear transformation is applied by calling a <cite>fc</cite> layer and the
<trclass="field-even field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><codeclass="xref py py-exc docutils literal"><spanclass="pre">ValueError</span></code>– The ranks of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be 2 or the 1st dimensions of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be the same.</p>
<trclass="field-even field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><codeclass="xref py py-exc docutils literal"><spanclass="pre">ValueError</span></code>– The ranks of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be 2 or the 1st dimensions of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be the same or the 2nd dimensions of <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be the same.</p>
@@ -1020,7 +1020,7 @@ the given labels as soft labels, default <cite>False</cite>.</li>
<trclass="field-even field"><thclass="field-name">返回:</th><tdclass="field-body"><pclass="first">A 2-D tensor with shape [N x 1], the cross entropy loss.</p>
</td>
</tr>
<trclass="field-odd field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><cite>ValueError</cite>– 1) the 1st dimension of <cite>input</cite> and <cite>label</cite> are not equal; 2) when <cite>soft_label == True</cite>, and the 2nd dimension of <cite>input</cite> and <cite>label</cite> are not equal; 3) when <cite>soft_label == False</cite>, and the 2nd dimension of <cite>label</cite> is not 1.</p>
<trclass="field-odd field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><cite>ValueError</cite>– 1) the 1st dimension of <cite>input</cite> and <cite>label</cite> are not equal; 2) when <cite>soft_label == True</cite>, and the 2nd dimension of <cite>input</cite> and <cite>label</cite> are not equal; 3) when <cite>soft_label == False</cite>, and the 2nd dimension of <cite>label</cite> is not 1.</p>
</td>
</tr>
</tbody>
...
...
@@ -2033,16 +2033,17 @@ explain how sequence_expand works:</p>
<dd><p>Lstm unit layer. The equation of a lstm step is:</p>
<blockquote>
<div><divclass="math">
\[ \begin{align}\begin{aligned}i_t & = \sigma(W_{x_i}x_{t} + W_{h_i}h_{t-1} + W_{c_i}c_{t-1} + b_i)\\f_t & = \sigma(W_{x_f}x_{t} + W_{h_f}h_{t-1} + W_{c_f}c_{t-1} + b_f)\\c_t & = f_tc_{t-1} + i_t tanh (W_{x_c}x_t+W_{h_c}h_{t-1} + b_c)\\o_t & = \sigma(W_{x_o}x_{t} + W_{h_o}h_{t-1} + W_{c_o}c_t + b_o)\\h_t & = o_t tanh(c_t)\end{aligned}\end{align} \]</div>
\[ \begin{align}\begin{aligned}i_t & = \sigma(W_{x_i}x_{t} + W_{h_i}h_{t-1} + b_i)\\f_t & = \sigma(W_{x_f}x_{t} + W_{h_f}h_{t-1} + b_f)\\c_t & = f_tc_{t-1} + i_t tanh (W_{x_c}x_t + W_{h_c}h_{t-1} + b_c)\\o_t & = \sigma(W_{x_o}x_{t} + W_{h_o}h_{t-1} + b_o)\\h_t & = o_t tanh(c_t)\end{aligned}\end{align} \]</div>
</div></blockquote>
<p>The inputs of lstm unit includes <spanclass="math">\(x_t\)</span>, <spanclass="math">\(h_{t-1}\)</span> and
<spanclass="math">\(c_{t-1}\)</span>. The implementation separates the linear transformation
and non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an
example. The linear transformation is applied by calling a <cite>fc</cite> layer and
the equation is:</p>
<p>The inputs of lstm unit include <spanclass="math">\(x_t\)</span>, <spanclass="math">\(h_{t-1}\)</span> and
<spanclass="math">\(c_{t-1}\)</span>. The 2nd dimensions of <spanclass="math">\(h_{t-1}\)</span> and <spanclass="math">\(c_{t-1}\)</span>
should be same. The implementation separates the linear transformation and
non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an example.
The linear transformation is applied by calling a <cite>fc</cite> layer and the
<trclass="field-even field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><codeclass="xref py py-exc docutils literal"><spanclass="pre">ValueError</span></code>– The ranks of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be 2 or the 1st dimensions of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be the same.</p>
<trclass="field-even field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><codeclass="xref py py-exc docutils literal"><spanclass="pre">ValueError</span></code>– The ranks of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be 2 or the 1st dimensions of <strong>x_t</strong>, <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be the same or the 2nd dimensions of <strong>hidden_t_prev</strong> and <strong>cell_t_prev</strong> not be the same.</p>