@@ -1007,7 +1007,7 @@ the given labels as soft labels, default <cite>False</cite>.</li>
...
@@ -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>
<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>
</td>
</tr>
</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>
</td>
</tr>
</tr>
</tbody>
</tbody>
...
@@ -2020,16 +2020,17 @@ explain how sequence_expand works:</p>
...
@@ -2020,16 +2020,17 @@ explain how sequence_expand works:</p>
<dd><p>Lstm unit layer. The equation of a lstm step is:</p>
<dd><p>Lstm unit layer. The equation of a lstm step is:</p>
<blockquote>
<blockquote>
<div><divclass="math">
<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>
</div></blockquote>
<p>The inputs of lstm unit includes <spanclass="math">\(x_t\)</span>, <spanclass="math">\(h_{t-1}\)</span> and
<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 implementation separates the linear transformation
<spanclass="math">\(c_{t-1}\)</span>. The 2nd dimensions of <spanclass="math">\(h_{t-1}\)</span> and <spanclass="math">\(c_{t-1}\)</span>
and non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an
should be same. The implementation separates the linear transformation and
example. The linear transformation is applied by calling a <cite>fc</cite> layer and
non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an example.
the equation is:</p>
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>
...
@@ -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>
<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>
</td>
</tr>
</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>
</td>
</tr>
</tr>
</tbody>
</tbody>
...
@@ -2033,16 +2033,17 @@ explain how sequence_expand works:</p>
...
@@ -2033,16 +2033,17 @@ explain how sequence_expand works:</p>
<dd><p>Lstm unit layer. The equation of a lstm step is:</p>
<dd><p>Lstm unit layer. The equation of a lstm step is:</p>
<blockquote>
<blockquote>
<div><divclass="math">
<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>
</div></blockquote>
<p>The inputs of lstm unit includes <spanclass="math">\(x_t\)</span>, <spanclass="math">\(h_{t-1}\)</span> and
<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 implementation separates the linear transformation
<spanclass="math">\(c_{t-1}\)</span>. The 2nd dimensions of <spanclass="math">\(h_{t-1}\)</span> and <spanclass="math">\(c_{t-1}\)</span>
and non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an
should be same. The implementation separates the linear transformation and
example. The linear transformation is applied by calling a <cite>fc</cite> layer and
non-linear transformation apart. Here, we take <spanclass="math">\(i_t\)</span> as an example.
the equation is:</p>
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>